Added 3 Lua player API properties

This commit is contained in:
Curtis Shmyr
2015-11-07 12:17:09 -07:00
parent 168dab9707
commit 2a6c87f81d

View File

@@ -24,6 +24,9 @@ namespace OpenRA.Mods.Common.Scripting
public PlayerProperties(ScriptContext context, Player player)
: base(context, player) { }
[Desc("The player's internal name.")]
public string InternalName { get { return Player.InternalName; } }
[Desc("The player's name.")]
public string Name { get { return Player.PlayerName; } }
@@ -52,6 +55,12 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Returns true if the player is a bot.")]
public bool IsBot { get { return Player.IsBot; } }
[Desc("Returns true if the player is non combatant.")]
public bool IsNonCombatant { get { return Player.NonCombatant; } }
[Desc("Returns true if the player is the local player.")]
public bool IsLocalPlayer { get { return Player == (Player.World.RenderPlayer ?? Player.World.LocalPlayer); } }
[Desc("Returns an array of actors representing all ground attack units of this player.")]
public Actor[] GetGroundAttackers()
{