private void InitCharacters() { string data = ""; data = IOManager.ReadData(mFilePath + cCharFileName); if (!string.IsNullOrEmpty(data)) { mCharacters.Clear(); JSONObject obj = JSONObject.Parse(data); JSONArray array = obj.GetArray(SerializableObject.CHARACTER_LIST); foreach (var val in array) { PlayerCharacter newChar = null; CharacterGame game = (CharacterGame)(int)val.Array[0].Number; switch (game) { case CharacterGame.DnD_3_5: newChar = new DnDCharacter(); break; default: break; } if (newChar != null) { newChar.Deserialize(val.Array[1].Obj); mCharacters.Add(newChar); } } } }
protected override void onInit(SceneProcedure lastProcedure, string intent) { LT.LOAD_UGUI_SHOW(LAYOUT_ILR.GAMING); uint id = (uint)makeID(); CommandCharacterManagerCreateCharacter cmd = newMainCmd(out cmd); cmd.mCharacterType = typeof(CharacterGame); cmd.mName = "test"; cmd.mID = id; pushCommand(cmd, mCharacterManager); mPlayer = mCharacterManager.getCharacter(id) as CharacterGame; }
// Constructor internal Game(Account account) { Server = new ServerGame(); Character = new CharacterGame(account); Map = new MapGame(account); Fight = new FightGame(account); Managers = new ManagersGame(account, Map); Chat = new ChatGame(account); Npcs = new NpcsGame(account); Storage = new StorageGame(account); Exchange = new ExchangeGame(account); Bid = new BidGame(account); }
public static string ToViewString(CharacterGame game) { switch (game) { case CharacterGame.DnD_3_5: return "D &D 3.5"; case CharacterGame.DnD_5_0: return "D &D 5"; case CharacterGame.Pathfinder: return "Pathfinder"; default: return ""; } }
public override void init(ComponentOwner owner) { base.init(owner); mPlayer = owner as CharacterGame; }