public GameData CreateGameData(GameData item, bool init = true, bool UserSoure = true) //复制 未知类型时 { GameData data = null; if (item == null) { return(null); } switch (item.DataType) { case GameDataType.King: data = new King(item, init, UserSoure); break; case GameDataType.Army: data = new Army(item, init, UserSoure); break; case GameDataType.Team: data = new Team(item, init, UserSoure); break; case GameDataType.Hero: data = new Hero(item, init, UserSoure); break; case GameDataType.TeamBuff: data = new TeamBuff(item, init, UserSoure); break; case GameDataType.UnitBuff: data = new UnitBuff(item, init, UserSoure); break; case GameDataType.Skill: data = new Skill(item, init, UserSoure); break; case GameDataType.City: data = new City(item, init, UserSoure); break; case GameDataType.UnitSetting: data = new UnitSetting(item, init, UserSoure); break; case GameDataType.Unit: data = new Unit(item, init, UserSoure); break; case GameDataType.ConversationData: data = new CommunicationData(item, init, UserSoure); break; case GameDataType.Other: data = new GameData(item); break; case GameDataType.DynamicGameSetting: data = new DynamicGameSetting(item); break; case GameDataType.StaticGameSetting: data = new StaticGameSetting(item); break; default: break; } return(data); }
public GameData CreateGameData(GameDataType type, string name) //这是为方便GameDataEditWindow 未知类型时 { GameData data = null; if (string.IsNullOrEmpty(name)) { return(null); } switch (type) { case GameDataType.King: data = new King(name); break; case GameDataType.Army: data = new Army(name); break; case GameDataType.Team: data = new Team(name); break; case GameDataType.Hero: data = new Hero(name); break; case GameDataType.TeamBuff: data = new TeamBuff(name); break; case GameDataType.UnitBuff: data = new UnitBuff(name); break; case GameDataType.Skill: data = new Skill(name); break; case GameDataType.City: data = new City(name); break; case GameDataType.UnitSetting: data = new UnitSetting(name); break; case GameDataType.Unit: data = new Unit(name); break; case GameDataType.ConversationData: data = new CommunicationData(name); break; case GameDataType.Other: data = new GameData(GameDataType.Other, name); break; case GameDataType.DynamicGameSetting: data = new DynamicGameSetting(name); break; case GameDataType.StaticGameSetting: data = new StaticGameSetting(name); break; default: break; } return(data); }
public GameSetting(DynamicGameSetting Dsetting, StaticGameSetting Ssetting) { Dynamic = Dsetting; Static = Ssetting; }
private static void InitGameSetting(DynamicGameSetting dynamicGameSetting, StaticGameSetting staticGameSetting) { Setting = new GameSetting(dynamicGameSetting, staticGameSetting); }
public void SetDynGameSetting(DynamicGameSetting setting) { GameSetting = setting; time = new DateTime((long)GameSetting.Time * 10000000 * 60); }