Difference between revisions of "Namespace Guide rtp"

From MINR.ORG WIKI
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Namespace Documentation|Return to namespace list]]
 +
 
= rtp =
 
= rtp =
'''Status: UNSTABLE (do not use)'''
+
'''Status: STABLE (safe to use)'''
  
 
== Types ==
 
== Types ==
 +
 
=== TpData===
 
=== TpData===
A data type to manage teleport destinations that are set by a player positioned at the desired location.
+
A data structure to manage teleport destinations that are set by a player positioned at the desired location.
  
 
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
 
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;>
 
==== Fields (6) ====
 
==== Fields (6) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
* Double x : x-coordinate of the teleport destination
+
* '''Double x''' : x-coordinate of the teleport destination
* Double y : y-coordinate of the teleport destination
+
* '''Double y''' : y-coordinate of the teleport destination
* Double z : z-coordinate of the teleport destination
+
* '''Double z''' : z-coordinate of the teleport destination
* Float yaw : yaw of the teleport destination
+
* '''Float yaw''' : yaw of the teleport destination
* Float pitch : pitch of the teleport destination
+
* '''Float pitch''' : pitch of the teleport destination
* String world : world of the teleport destination
+
* '''String world''' : world of the teleport destination
 
</div></div>
 
</div></div>
  
Line 20: Line 23:
 
==== Constructors (1) ====
 
==== Constructors (1) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
foobar
+
* '''rtp::TpData(Player setter)''' : destination fields are set to match the ''setter''<nowiki>'</nowiki>s position at the time of initialization
 
</div></div>
 
</div></div>
  
<div class="toccolours mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
==== Methods ====
+
==== Methods (3) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
foobar
+
* '''String string()''' : returns a simplified representation of the position held by the structure
 +
* '''String tpString()''' : returns a string representation of an anonymous tp call performed by tpHere
 +
* '''Void tpHere(Player player)''': teleports the ''player'' to the position held by the structure
 
</div></div>
 
</div></div>
  
 
=== Rtp ===
 
=== Rtp ===
 +
A TpData list selector and management tool that mimics the /rtp plugin functionality.
  
<div class="toccolours mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
==== Fields ====
+
==== Fields (3) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
* String name
+
* '''String name''' : custom identifier for the set of teleport locations
* Boolean doLogging
+
* '''Boolean doLogging''' : flag to enable logging of each use of teleportation
 +
* '''rtp::TpData[] tpList''' : list of potential teleport locations
 
</div></div>
 
</div></div>
  
<div class="toccolours mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
==== Constructors ====
+
==== Constructors (4) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
foobar
+
* '''rtp::Rtp()''' : initialize an empty location manager (defaults "UNNAMED", true)
 +
* '''rtp::Rtp(String name)''' : initialize a location manager with identifier name set
 +
* '''rtp::Rtp(Boolean doLogging)''' : initialize with logging option set
 +
* '''rtp::Rtp(String name, Boolean doLogging)''' : initialize with name and logging set
 
</div></div>
 
</div></div>
  
<div class="toccolours mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
+
<div class="mw-collapsible mw-collapsed" style="border:1px solid #888888; padding:7px;">
==== Methods ====
+
==== Methods (8) ====
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
foobar
+
* '''String string()''' : returns a representation of name, logging status, and capacity of the structure
 +
* '''Int count()''' : returns size of the managed location list
 +
* '''Void setName(String name)''' : updates the name of the structure
 +
* '''Void setLogging(Boolean doLogging)''' : updates the logging status of the structure
 +
* '''Void addWarp(Player setter)''' : adds a location generated from ''setter''<nowiki>'</nowiki>s position at the time of the function call
 +
* '''Void removeWarp(Int index)''' : removes a location specified by the ''index'' (between 1 and Rtp.count() inclusive)
 +
* '''Void useWarp(Player player, Int index)''' : warps the ''player'' to the location specified by ''index'' (1 to count() inclusive), performing optional logging
 +
* '''Void rtp(Player player)''' : Selects a location randomly and performs the actions of useWarp using the ''player''
 
</div></div>
 
</div></div>

Latest revision as of 02:21, 30 April 2020

Return to namespace list

rtp[edit]

Status: STABLE (safe to use)

Types[edit]

TpData[edit]

A data structure to manage teleport destinations that are set by a player positioned at the desired location.

Fields (6)[edit]

  • Double x : x-coordinate of the teleport destination
  • Double y : y-coordinate of the teleport destination
  • Double z : z-coordinate of the teleport destination
  • Float yaw : yaw of the teleport destination
  • Float pitch : pitch of the teleport destination
  • String world : world of the teleport destination

Constructors (1)[edit]

  • rtp::TpData(Player setter) : destination fields are set to match the setter's position at the time of initialization

Methods (3)[edit]

  • String string() : returns a simplified representation of the position held by the structure
  • String tpString() : returns a string representation of an anonymous tp call performed by tpHere
  • Void tpHere(Player player): teleports the player to the position held by the structure

Rtp[edit]

A TpData list selector and management tool that mimics the /rtp plugin functionality.

Fields (3)[edit]

  • String name : custom identifier for the set of teleport locations
  • Boolean doLogging : flag to enable logging of each use of teleportation
  • rtp::TpData[] tpList : list of potential teleport locations

Constructors (4)[edit]

  • rtp::Rtp() : initialize an empty location manager (defaults "UNNAMED", true)
  • rtp::Rtp(String name) : initialize a location manager with identifier name set
  • rtp::Rtp(Boolean doLogging) : initialize with logging option set
  • rtp::Rtp(String name, Boolean doLogging) : initialize with name and logging set

Methods (8)[edit]

  • String string() : returns a representation of name, logging status, and capacity of the structure
  • Int count() : returns size of the managed location list
  • Void setName(String name) : updates the name of the structure
  • Void setLogging(Boolean doLogging) : updates the logging status of the structure
  • Void addWarp(Player setter) : adds a location generated from setter's position at the time of the function call
  • Void removeWarp(Int index) : removes a location specified by the index (between 1 and Rtp.count() inclusive)
  • Void useWarp(Player player, Int index) : warps the player to the location specified by index (1 to count() inclusive), performing optional logging
  • Void rtp(Player player) : Selects a location randomly and performs the actions of useWarp using the player