示例#1
0
 public Player(PlayerTemplate template)
 {
     Template       = template;
     _selectedUnits = new HashSet <GameObject>();
     _allies        = new HashSet <Player>();
     _enemies       = new HashSet <Player>();
 }
示例#2
0
 public PlayerSetting(int?startPosition, PlayerTemplate template, ColorRgb color, PlayerOwner owner = PlayerOwner.None, string name = "")
 {
     StartPosition = startPosition;
     Template      = template;
     Color         = color;
     Owner         = owner;
     Name          = name;
 }
示例#3
0
文件: Player.cs 项目: tzhtdx/OpenSAGE
 public static Player FromTemplate(PlayerTemplate template, ContentManager content)
 {
     // TODO: Use rest of the properties from the template
     return(new Player
     {
         Side = ParseSide(template.Side),
         Name = content.TranslationManager.Lookup(template.DisplayName),
         Money = (uint)template.StartMoney
     });
 }
示例#4
0
 public static Player FromTemplate(PlayerTemplate template, ContentManager content, PlayerSetting?setting = null)
 {
     // TODO: Use rest of the properties from the template
     return(new Player
     {
         Side = template.Side,
         Name = template.Name,
         DisplayName = template.DisplayName.Translate(),
         Money = (uint)template.StartMoney,
         Color = setting.HasValue ? setting.Value.Color : template.PreferredColor
     });
 }
示例#5
0
 public static Player FromTemplate(PlayerTemplate template, ContentManager content)
 {
     // TODO: Use rest of the properties from the template
     return(new Player
     {
         Side = template.Side,
         Name = template.Name,
         DisplayName = content.TranslationManager.Lookup(template.DisplayName),
         Money = (uint)template.StartMoney,
         Color = template.PreferredColor.ToColorRgb()
     });
 }
示例#6
0
 public static Player FromTemplate(GameData gameData, PlayerTemplate template, PlayerSetting?setting = null)
 {
     // TODO: Use rest of the properties from the template
     return(new Player(template)
     {
         Side = template.Side,
         Name = setting == null ? template.Name : setting?.Name,
         DisplayName = template.DisplayName.Translate(),
         Money = (uint)(template.StartMoney + gameData.DefaultStartingCash),
         Color = setting.HasValue ? setting.Value.Color : template.PreferredColor,
         IsHuman = setting?.Owner == PlayerOwner.Player
     });
 }
示例#7
0
 public Player(PlayerTemplate template, in ColorRgb color)