public Player(PlayerTemplate template) { Template = template; _selectedUnits = new HashSet <GameObject>(); _allies = new HashSet <Player>(); _enemies = new HashSet <Player>(); }
public PlayerSetting(int?startPosition, PlayerTemplate template, ColorRgb color, PlayerOwner owner = PlayerOwner.None, string name = "") { StartPosition = startPosition; Template = template; Color = color; Owner = owner; Name = name; }
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 }); }
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 }); }
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() }); }
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 }); }
public Player(PlayerTemplate template, in ColorRgb color)