Пример #1
0
 /// <summary>
 /// TurnDataを初期化します。
 /// </summary>
 public TurnData(TurnData turnData)
 {
     Agents             = new Agents(turnData.Agents);
     AgentsActivityData = new AgentsActivityData(turnData.AgentsActivityData);
     Field = new Field(turnData.Field.Width, turnData.Field.Height);
     for (int x = 0; x < Field.Width; x++)
     {
         for (int y = 0; y < Field.Height; y++)
         {
             Field[x, y] = new Cell(turnData.Field[x, y]);
         }
     }
 }
Пример #2
0
        /// <summary>
        /// XmlTurnData を指定します。
        /// </summary>
        /// <param name="turnData">対象のターンデータ</param>
        public XmlTurnData(TurnData turnData)
        {
            Agents = new Agent[4];
            for (int i = 0; i < 4; i++)
            {
                Agents[i] = turnData.Agents[(Team)(i / 2), (AgentNumber)(i % 2)];
            }
            AgentActivityDatas = turnData.AgentsActivityData;
            Height             = turnData.Field.Height;
            Width = turnData.Field.Width;
            var max = Height * Width;

            Field = new XmlCell[max];
            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    Field[y * Width + x] = new XmlCell(turnData.Field[x, y]);
                }
            }
        }