コード例 #1
0
    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);
    }
コード例 #2
0
    public static SolaSaver getInstance()
    {
        if (_instance == null)
        {
            _instance = new SolaSaver();
        }

        return(_instance);
    }
コード例 #3
0
ファイル: MissionModel.cs プロジェクト: forzenheart/OtomeBall
    public void setStatus(int status)
    {
        _status = status;

        SolaEngine engine = SolaEngine.getInstance();
        MissionMgr mMgr   = (MissionMgr)engine.getMgr(typeof(MissionMgr));

        mMgr.saveData();
        SolaSaver.getInstance().save();
    }
コード例 #4
0
    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);
    }
コード例 #5
0
ファイル: PartnerMgr.cs プロジェクト: forzenheart/OtomeBall
    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);
    }
コード例 #6
0
    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);
    }