Beispiel #1
0
    /// <summary>
    /// ロード
    /// </summary>
    private void Load()
    {
        //ワールドID順に並び変えておく
        this.response.tSingleWorld = this.response.tSingleWorld.OrderBy(x => x.worldId).ToArray();

        //ワールドデータ
        this.worldData = new WorldData[this.response.tSingleWorld.Length];

        for (int i = 0; i < this.worldData.Length; i++)
        {
            uint worldId = this.response.tSingleWorld[i].worldId;
            this.worldData[i] = new WorldData();
            this.worldData[i].worldServerData = this.response.tSingleWorld[i];
            this.worldData[i].worldMasterData = Masters.SingleWorldDB.FindById(worldId);
            this.worldData[i].stageMasterData = Masters.SingleStageDB.GetList().Where(x => x.worldId == worldId).ToArray();
        }

        for (int i = 0; i < this.worldData.Length; i++)
        {
            /*uint worldId = this.response.tSingleWorld[i].worldId;
             * this.worldData[i] = new WorldData();
             * this.worldData[i].worldServerData = this.response.tSingleWorld[i];
             * this.worldData[i].worldMasterData = Masters.SingleWorldDB.FindById(worldId);
             * this.worldData[i].stageMasterData = Masters.SingleStageDB.GetList().Where(x => x.worldId == worldId).ToArray();*/
            this.worldData[i].stageServerData = this.worldData[i].stageMasterData
                                                .Select(stageMaster =>
            {
                var result = this.response.tSingleStage.FirstOrDefault(stageServer => stageServer.stageId == stageMaster.id);
                if (result == null)
                {
                    result             = new SinglePlayApi.TSingleStage();
                    result.stageId     = stageMaster.id;
                    result.stageStatus = (uint)SinglePlayApi.Status.NotOpen;
                    result.clearRank   = (uint)Rank.None;
                }
                else if (stageMaster.type == (uint)Master.SingleStageData.StageType.Battle && result.IsOpen())
                {
                    this.loader.Add <Sprite>(SharkDefine.GetSingleStageIconSpritePath(stageMaster.key));
                }
                return(result);
            })
                                                .ToArray();

            if (this.worldData[i].worldMasterData.isComingSoon > 0)
            {
                //ComingSoonワールドの場合、ComingSoonじゃないワールドの背景を利用する
                var prev = this.worldData.Last(x => x.worldMasterData.isComingSoon == 0);
                this.worldData[i].bgAssetLoader = prev.bgAssetLoader;
            }
            else
            {
                //背景の読み込み
                string bgPath = SharkDefine.GetStageSelectBgSpritePath(this.worldData[i].worldMasterData.key);
                this.loader.Add(this.worldData[i].bgAssetLoader = new AssetLoader <Sprite>(bgPath));
            }
        }

        //ロード実行
        this.loader.Load(this.OnLoaded);
    }
        /// <summary>
        /// ロード
        /// </summary>
        private void Load()
        {
            //ワールドID順に並び変えておく
            this.scene.response.tMultiWorld    = this.scene.response.tMultiWorld.OrderBy(x => x.multiWorldId).ToArray();
            this.scene.response.tMultiJackpot  = this.scene.response.tMultiJackpot.OrderBy(x => x.worldId).ToArray();
            this.scene.response.tMultiSoulBall = this.scene.response.tMultiSoulBall.OrderBy(x => x.worldId).ToArray();

            //ワールドデータ
            this.scene.worldData = new WorldData[this.scene.response.tMultiWorld.Length];

            for (int i = 0; i < this.scene.worldData.Length; i++)
            {
                uint worldId = this.scene.response.tMultiWorld[i].multiWorldId;
                this.scene.worldData[i] = new WorldData();

                this.scene.worldData[i].worldServerData      = this.scene.response.tMultiWorld[i];
                this.scene.worldData[i].worldMasterData      = Masters.MultiWorldDB.FindById(worldId);
                this.scene.worldData[i].worldJackpotInfoData = this.scene.response.tMultiJackpot[i];
                // tMultiSoulBallの配列の長さチェック
                if (i < this.scene.response.tMultiSoulBall.Length)
                {
                    this.scene.worldData[i].multiSoulBallData = this.scene.response.tMultiSoulBall[i];
                }
            }
            for (int i = 0; i < this.scene.worldData.Length; i++)
            {
                if (this.scene.worldData[i].worldMasterData.isComingSoon > 0)
                {
                    //ComingSoonワールドの場合、ComingSoonじゃないワールドの背景を利用する
                    var prev = this.scene.worldData.Last(x => x.worldMasterData.isComingSoon == 0);
                    this.scene.worldData[i].bgAssetLoader = prev.bgAssetLoader;
                }
                else
                {
                    //背景の読み込み
                    string bgPath = SharkDefine.GetStageSelectBgSpritePath(this.scene.worldData[i].worldMasterData.key);
                    this.scene.loader.Add(this.scene.worldData[i].bgAssetLoader = new AssetLoader <Sprite>(bgPath));
                }
            }

            //ロード実行
            this.scene.loader.Load(this.OnLoaded);
        }