private bool _startUp() { _curSceneName = ScenesName.LOGIN; InitHandlers initHandlers = new InitHandlers(); initHandlers.init(); // SocketHelper.GetInstance ().setHandlers (initHandlers.getHandlers ()); InitEvents initEvents = new InitEvents(); initEvents.init(); InitConfigs initCfgs = new InitConfigs(); initCfgs.init(); _cfgs = initCfgs.getCfgs(); InitMgrs initMgr = new InitMgrs(); initMgr.init(); _mgrs = initMgr.getMgrs(); initMgr.inited(); SolaSaver saver = SolaSaver.getInstance(); JsonObject data = saver.load(); foreach (BaseMgr mgr in _mgrs.Values) { mgr.loadData(data); } return(true); }
public static SolaSaver getInstance() { if (_instance == null) { _instance = new SolaSaver(); } return(_instance); }
public void setStatus(int status) { _status = status; SolaEngine engine = SolaEngine.getInstance(); MissionMgr mMgr = (MissionMgr)engine.getMgr(typeof(MissionMgr)); mMgr.saveData(); SolaSaver.getInstance().save(); }
public override bool saveData() { _roleData [RoleData.ROLE_ID] = _roleId; _roleData [RoleData.ROLE_LEVEL] = _roleLevel; _roleData [RoleData.ROLE_EXP] = _roleExp; _roleData [RoleData.ROLE_GOLD] = _gold; _roleData [RoleData.ROLE_PAPER] = _paper; SolaSaver.getInstance().save(); return(true); }
public override bool saveData() { _parnerData [PartnerData.LEADER_POS] = _leaderPos; JsonObject partnerInfos = new JsonObject(); foreach (int pos in _partners.Keys) { partnerInfos[pos.ToString()] = _partners[pos].getId(); } _parnerData [PartnerData.PARTNER_INFOS] = partnerInfos; SolaSaver.getInstance().save(); return(true); }
public override bool saveData() { if (_heroData == null) { return(false); } JsonObject heroInfos = new JsonObject(); foreach (HeroModel model in _modelList) { int heroId = model.getId(); heroInfos [heroId.ToString()] = model.getSavaData(); } _heroData [HeroData.HERO_INFOS] = heroInfos; _heroData [HeroData.HERO_INDEX] = _heroIndex; SolaSaver.getInstance().save(); return(true); }