diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs
index 6bd05c5..996ea01 100644
--- a/GamecraftModdingAPI/Player.cs
+++ b/GamecraftModdingAPI/Player.cs
@@ -7,11 +7,19 @@ using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI
{
+ ///
+ /// An in-game player character. Any Leo you see is a player.
+ ///
public class Player
{
// static functionality
private static PlayerEngine playerEngine = new PlayerEngine();
+ ///
+ /// Checks if the specified player exists.
+ ///
+ /// Whether the player exists.
+ /// Player type.
public static bool Exists(PlayerType player)
{
switch (player)
@@ -24,11 +32,20 @@ namespace GamecraftModdingAPI
return false;
}
+ ///
+ /// Checks if the specified player exists.
+ ///
+ /// Whether the player exists.
+ /// The player's unique identifier.
public static bool Exists(uint player)
{
return playerEngine.ExistsById(player);
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player's unique identifier.
public Player(uint id)
{
this.Id = id;
@@ -39,6 +56,10 @@ namespace GamecraftModdingAPI
this.Type = playerEngine.GetLocalPlayer() == id ? PlayerType.Local : PlayerType.Remote;
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player type. Chooses the first available player matching the criteria.
public Player(PlayerType player)
{
uint localId = playerEngine.GetLocalPlayer();
@@ -60,10 +81,23 @@ namespace GamecraftModdingAPI
// object fields & properties
+ ///
+ /// The player's type.
+ /// The player type is always relative to the current client, not the game host.
+ ///
+ /// The enumerated player type.
public PlayerType Type { get; }
+ ///
+ /// The player's unique identifier.
+ ///
+ /// The identifier.
public uint Id { get; private set; }
+ ///
+ /// The player's current position.
+ ///
+ /// The position.
public float3 Position
{
get
@@ -77,6 +111,10 @@ namespace GamecraftModdingAPI
}
}
+ ///
+ /// The player's current rotation.
+ ///
+ /// The rotation.
public quaternion Rotation
{
get
@@ -90,6 +128,10 @@ namespace GamecraftModdingAPI
}
}
+ ///
+ /// The player's current velocity.
+ ///
+ /// The velocity.
public float3 Velocity
{
get
@@ -103,6 +145,10 @@ namespace GamecraftModdingAPI
}
}
+ ///
+ /// The player's current angular velocity.
+ ///
+ /// The angular velocity.
public float3 AngularVelocity
{
get
@@ -116,6 +162,10 @@ namespace GamecraftModdingAPI
}
}
+ ///
+ /// The player's mass.
+ ///
+ /// The mass.
public float Mass
{
get
@@ -123,14 +173,19 @@ namespace GamecraftModdingAPI
return 1f / playerEngine.GetMass(Id).InverseMass;
}
- set
+ // FIXME: Setting mass doesn't do anything
+ /*set
{
playerEngine.SetInverseMass(Id, 1f / value);
- }
+ }*/
}
private float _ping = -1f;
+ ///
+ /// The player's latest network ping time.
+ ///
+ /// The ping (s).
public float Ping
{
get
@@ -146,6 +201,14 @@ namespace GamecraftModdingAPI
// object methods
+ ///
+ /// Teleport the player to the specified coordinates.
+ ///
+ /// The x coordinate.
+ /// The y coordinate.
+ /// The z coordinate.
+ /// If set to true teleport relative to the player's current position.
+ /// If set to true exit any seat the player is in.
public void Teleport(float x, float y, float z, bool relative = true, bool exitSeat = true)
{
float3 location = new float3(x, y, z);