Ejemplo n.º 1
0
        public List <HistoryModelBase> CreateHistoryData()
        {
            List <HistoryModelBase> list = new List <HistoryModelBase>();
            Api_Result <List <User_HistoryFmt> > api_Result = new Api_get_Member().HistoryList();

            if (api_Result.state == Api_Result_State.Success)
            {
                for (int i = 0; i < api_Result.data.Count; i++)
                {
                    User_HistoryFmt user_HistoryFmt = api_Result.data[i];
                    if (user_HistoryFmt.Type == HistoryType.MapClear1 || user_HistoryFmt.Type == HistoryType.MapClear2 || user_HistoryFmt.Type == HistoryType.MapClear3)
                    {
                        list.Add(new HistoryModel_AreaClear(user_HistoryFmt));
                    }
                    else if (user_HistoryFmt.Type == HistoryType.NewAreaOpen)
                    {
                        list.Add(new HistoryModel_AreaStart(user_HistoryFmt));
                    }
                    else if (user_HistoryFmt.Type == HistoryType.TankerLostAll || user_HistoryFmt.Type == HistoryType.TankerLostHalf)
                    {
                        list.Add(new HistoryModel_TransportCraft(user_HistoryFmt));
                    }
                    else if (user_HistoryFmt.Type == HistoryType.GameClear || user_HistoryFmt.Type == HistoryType.GameOverLost || user_HistoryFmt.Type == HistoryType.GameOverTurn)
                    {
                        list.Add(new HistoryModel_GameEnd(user_HistoryFmt));
                    }
                }
            }
            return(list);
        }
 private string _setHistoryDate(User_HistoryFmt fmt)
 {
     return(string.Concat(new string[]
     {
         fmt.DateString.Year,
         "年",
         fmt.DateString.Month,
         string.Empty,
         fmt.DateString.Day,
         "日 "
     }));
 }
        private string _setHistoryType(User_HistoryFmt fmt)
        {
            string result = string.Empty;
            string text   = string.Empty;

            switch (fmt.Type)
            {
            case HistoryType.MapClear1:
                result = this._setHistory(string.Empty, fmt.DateString.Year, fmt.DateString.Month, fmt.DateString.Day, fmt.MapInfo.Name, fmt.MapInfo.Opetext, fmt.FlagShip.Name);
                break;

            case HistoryType.MapClear2:
                result = this._setHistory("第二次", fmt.DateString.Year, fmt.DateString.Month, fmt.DateString.Day, fmt.MapInfo.Name, fmt.MapInfo.Opetext, fmt.FlagShip.Name);
                break;

            case HistoryType.MapClear3:
                result = this._setHistory("第三次", fmt.DateString.Year, fmt.DateString.Month, fmt.DateString.Day, fmt.MapInfo.Name, fmt.MapInfo.Opetext, fmt.FlagShip.Name);
                break;

            case HistoryType.TankerLostHalf:
                text   = this._setHistoryDate(fmt);
                result = text + fmt.AreaName + " 輸送船団遭難";
                break;

            case HistoryType.TankerLostAll:
                text   = this._setHistoryDate(fmt);
                result = text + fmt.AreaName + " 輸送船団全滅";
                break;

            case HistoryType.NewAreaOpen:
                text   = this._setHistoryDate(fmt);
                result = text + fmt.AreaName + " 攻略開始";
                break;

            case HistoryType.GameOverLost:
                text   = this._setHistoryDate(fmt);
                result = text + "本土沖海戦 敗北(艦隊壊滅)";
                break;

            case HistoryType.GameOverTurn:
                text   = this._setHistoryDate(fmt);
                result = text + "終戦";
                break;

            case HistoryType.GameClear:
                text   = this._setHistoryDate(fmt);
                result = text + "勝利";
                break;
            }
            return(result);
        }
        public Api_Result <List <User_HistoryFmt> > HistoryList()
        {
            Api_Result <List <User_HistoryFmt> > api_Result = new Api_Result <List <User_HistoryFmt> >();
            List <User_HistoryFmt> list = new List <User_HistoryFmt>();

            api_Result.data = list;
            List <Mem_history> list2 = new List <Mem_history>();

            using (Dictionary <int, List <Mem_history> > .ValueCollection.Enumerator enumerator = Comm_UserDatas.Instance.User_history.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    List <Mem_history> current = enumerator.get_Current();
                    list2.AddRange(current);
                }
            }
            if (list2.get_Count() == 0)
            {
                return(api_Result);
            }
            IOrderedEnumerable <Mem_history> orderedEnumerable = Enumerable.OrderBy <Mem_history, int>(list2, (Mem_history x) => x.Rid);

            using (IEnumerator <Mem_history> enumerator2 = orderedEnumerable.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    Mem_history current2 = enumerator2.get_Current();
                    if (current2.Type != 999)
                    {
                        User_HistoryFmt user_HistoryFmt = new User_HistoryFmt(current2);
                        list.Add(user_HistoryFmt);
                    }
                }
            }
            if (Comm_UserDatas.Instance.User_kdock.get_Count() == 0)
            {
                Mem_history mem_history = new Mem_history();
                mem_history.SetGameOverToLost(Comm_UserDatas.Instance.User_turn.Total_turn);
                User_HistoryFmt user_HistoryFmt2 = new User_HistoryFmt(mem_history);
                list.Add(user_HistoryFmt2);
            }
            api_Result.data = list;
            return(api_Result);
        }
        private void _createHistoryLabel()
        {
            if (Utils.IsGameOver())
            {
                if (this._isTurnOver)
                {
                    this._gameoverTxt1.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverB1") as Texture2D);
                    this._gameoverTxt2.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverB2") as Texture2D);
                }
                else
                {
                    this._gameoverTxt1.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverA1") as Texture2D);
                    this._gameoverTxt2.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverA2") as Texture2D);
                }
                this._gameoverTxt1.MakePixelPerfect();
                this._gameoverTxt2.MakePixelPerfect();
            }
            Api_Result <List <User_HistoryFmt> > api_Result = new Api_get_Member().HistoryList();

            for (int i = 0; i < api_Result.data.get_Count(); i++)
            {
                User_HistoryFmt user_HistoryFmt = api_Result.data.get_Item(i);
                if (user_HistoryFmt != null)
                {
                    UILabel uILabel = Object.Instantiate <UILabel>(this._historyLabel);
                    uILabel.get_transform().set_parent(this._historyLabel.get_transform().get_parent());
                    uILabel.get_transform().set_localPosition(this._historyLabel.get_transform().get_localPosition());
                    uILabel.get_transform().set_localScale(Vector3.get_one());
                    uILabel.text = this._setHistoryType(user_HistoryFmt);
                    uILabel.MakePixelPerfect();
                    this._lstHistoryLabel.Add(uILabel);
                    if (user_HistoryFmt.Type == HistoryType.GameOverLost)
                    {
                        UILabel uILabel2 = Object.Instantiate <UILabel>(this._historyLabel);
                        uILabel2.get_transform().set_parent(this._historyLabel.get_transform().get_parent());
                        uILabel2.get_transform().set_localPosition(this._historyLabel.get_transform().get_localPosition());
                        uILabel2.get_transform().set_localScale(Vector3.get_one());
                        uILabel2.text = "\u3000\u3000\u3000\u3000\u3000\u3000 敗戦";
                        uILabel2.MakePixelPerfect();
                        this._lstHistoryLabel.Add(uILabel2);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void _createHistoryLabel()
        {
            if (Server_Common.Utils.IsGameOver())
            {
                if (_isTurnOver)
                {
                    _gameoverTxt1.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverB1") as Texture2D);
                    _gameoverTxt2.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverB2") as Texture2D);
                }
                else
                {
                    _gameoverTxt1.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverA1") as Texture2D);
                    _gameoverTxt2.mainTexture = (Resources.Load("Textures/Ending/txt_gamoverA2") as Texture2D);
                }
                _gameoverTxt1.MakePixelPerfect();
                _gameoverTxt2.MakePixelPerfect();
            }
            Api_Result <List <User_HistoryFmt> > api_Result = new Api_get_Member().HistoryList();

            for (int i = 0; i < api_Result.data.Count; i++)
            {
                User_HistoryFmt user_HistoryFmt = api_Result.data[i];
                if (user_HistoryFmt != null)
                {
                    UILabel uILabel = UnityEngine.Object.Instantiate(_historyLabel);
                    uILabel.transform.parent        = _historyLabel.transform.parent;
                    uILabel.transform.localPosition = _historyLabel.transform.localPosition;
                    uILabel.transform.localScale    = Vector3.one;
                    uILabel.text = _setHistoryType(user_HistoryFmt);
                    uILabel.MakePixelPerfect();
                    _lstHistoryLabel.Add(uILabel);
                    if (user_HistoryFmt.Type == HistoryType.GameOverLost)
                    {
                        UILabel uILabel2 = UnityEngine.Object.Instantiate(_historyLabel);
                        uILabel2.transform.parent        = _historyLabel.transform.parent;
                        uILabel2.transform.localPosition = _historyLabel.transform.localPosition;
                        uILabel2.transform.localScale    = Vector3.one;
                        uILabel2.text = "\u3000\u3000\u3000\u3000\u3000\u3000 敗戦";
                        uILabel2.MakePixelPerfect();
                        _lstHistoryLabel.Add(uILabel2);
                    }
                }
            }
        }
Ejemplo n.º 7
0
        public Api_Result <List <User_HistoryFmt> > HistoryList()
        {
            Api_Result <List <User_HistoryFmt> > api_Result = new Api_Result <List <User_HistoryFmt> >();
            List <User_HistoryFmt> list  = api_Result.data = new List <User_HistoryFmt>();
            List <Mem_history>     list2 = new List <Mem_history>();

            foreach (List <Mem_history> value in Comm_UserDatas.Instance.User_history.Values)
            {
                list2.AddRange(value);
            }
            if (list2.Count == 0)
            {
                return(api_Result);
            }
            IOrderedEnumerable <Mem_history> orderedEnumerable = from x in list2
                                                                 orderby x.Rid
                                                                 select x;

            foreach (Mem_history item3 in orderedEnumerable)
            {
                if (item3.Type != 999)
                {
                    User_HistoryFmt item = new User_HistoryFmt(item3);
                    list.Add(item);
                }
            }
            if (Comm_UserDatas.Instance.User_kdock.Count == 0)
            {
                Mem_history mem_history = new Mem_history();
                mem_history.SetGameOverToLost(Comm_UserDatas.Instance.User_turn.Total_turn);
                User_HistoryFmt item2 = new User_HistoryFmt(mem_history);
                list.Add(item2);
            }
            api_Result.data = list;
            return(api_Result);
        }
 public HistoryModel_AreaClear(User_HistoryFmt fmt) : base(fmt)
 {
     this._mst_ship = new ShipModelMst(fmt.FlagShip);
 }
Ejemplo n.º 9
0
 public HistoryModel_AreaStart(User_HistoryFmt fmt)
     : base(fmt)
 {
 }
 public HistoryModel_TransportCraft(User_HistoryFmt fmt) : base(fmt)
 {
 }
Ejemplo n.º 11
0
 public HistoryModel_GameEnd(User_HistoryFmt fmt)
     : base(fmt)
 {
 }
 public HistoryModelBase(User_HistoryFmt fmt)
 {
     this._fmt = fmt;
 }
Ejemplo n.º 13
0
 private string _setHistoryDate(User_HistoryFmt fmt)
 {
     return(fmt.DateString.Year + "年" + fmt.DateString.Month + string.Empty + fmt.DateString.Day + "日 ");
 }