Expose more PlayerProperties to lua

This commit is contained in:
abcdefg30
2015-05-27 16:50:55 +02:00
parent 27db5851e2
commit 91f62b5741

View File

@@ -12,6 +12,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Eluant; using Eluant;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits; using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting; using OpenRA.Scripting;
@@ -26,6 +27,21 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("The player's name.")] [Desc("The player's name.")]
public string Name { get { return Player.PlayerName; } } public string Name { get { return Player.PlayerName; } }
[Desc("The player's color.")]
public HSLColor Color { get { return Player.Color; } }
[Desc("The player's race.")]
public string Race { get { return Player.PlayerReference.Race; } }
[Desc("The player's spawnpoint ID.")]
public int Spawn { get { return Player.SpawnPoint; } }
[Desc("The player's team ID.")]
public int Team { get { return Player.PlayerReference.Team; } }
[Desc("Returns true if the player is a bot.")]
public bool IsBot { get { return Player.IsBot; } }
[Desc("Returns an array of actors representing all ground attack units of this player.")] [Desc("Returns an array of actors representing all ground attack units of this player.")]
public Actor[] GetGroundAttackers() public Actor[] GetGroundAttackers()
{ {