Пример #1
0
        /// <summary>
        /// 破棄
        /// </summary>
        public void Destory()
        {
            MapChipFactory.Instance.Release(this.chip);

            this.chip  = null;
            this.props = null;
            this.Coord = Vector2Int.zero;
        }
Пример #2
0
        //-------------------------------------------------------------------------
        // 基本的なメソッド

        /// <summary>
        /// 座標とPropsを指定したセットアップ
        /// </summary>
        public virtual FieldItem Setup(Props props)
        {
            this.props = props;
            this.chip  = MapChipFactory.Instance.CreateItemChip(props.Group.ChipType);

            Status = new Status(new Status.Props(props.Item.Name, 1, 0, 0));
            return(this);
        }
Пример #3
0
        public async Task <CompleteEntryHistory> GetCompleteEntryHistory(CompleteEntryHistory completeEntryHistory, int teamId)
        {
            HttpClientHandler handler = new HttpClientHandler();

            var response = await _httpClient.GetAuthAsync(CreateHandler(handler), $"entry/{teamId}/history/");

            response.EnsureSuccessStatusCode();

            var content = await response.Content.ReadAsStringAsync();

            var currentSeasonEntryHistoryJSON = AllChildren(JObject.Parse(content))
                                                .First(c => c.Type == JTokenType.Array && c.Path.Contains("current"))
                                                .Children <JObject>();

            List <EntryHistory> currentSeasonEntryHistory = new List <EntryHistory>();
            int totalTransfers    = 0;
            int totalTransferCost = 0;

            foreach (JObject result in currentSeasonEntryHistoryJSON)
            {
                EntryHistory eh = result.ToObject <EntryHistory>();
                currentSeasonEntryHistory.Add(eh);
                totalTransfers    += eh.event_transfers;
                totalTransferCost += eh.event_transfers_cost;
            }

            var chipsUsedJSON = AllChildren(JObject.Parse(content))
                                .First(c => c.Type == JTokenType.Array && c.Path.Contains("chips"))
                                .Children <JObject>();

            List <BasicChip> chipsUsed = new List <BasicChip>();

            foreach (JObject result in chipsUsedJSON)
            {
                BasicChip bc = result.ToObject <BasicChip>();
                chipsUsed.Add(bc);
            }

            completeEntryHistory.CurrentSeasonEntryHistory = currentSeasonEntryHistory;
            completeEntryHistory.ChipsUsed          = chipsUsed;
            completeEntryHistory.TotalTransfersMade = totalTransfers;
            completeEntryHistory.TotalTransfersCost = totalTransferCost;

            return(completeEntryHistory);
        }