Exemplo n.º 1
0
 public Player(PlayerTemplate template)
 {
     Template       = template;
     _selectedUnits = new HashSet <GameObject>();
     _allies        = new HashSet <Player>();
     _enemies       = new HashSet <Player>();
 }
Exemplo n.º 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;
 }
Exemplo n.º 3
0
 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
     });
 }
Exemplo n.º 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
     });
 }
Exemplo n.º 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()
     });
 }
Exemplo n.º 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
     });
 }
Exemplo n.º 7
0
 public Player(PlayerTemplate template, in ColorRgb color)