/// <summary> /// Fieldの初期化を行います。 /// </summary> /// <param name="cell">コピーするマスを指定します。</param> public Cell(XmlCell cell) { Point = cell.Point; IsTileOn = new TeamBool(); IsEnclosed = new TeamBool(); foreach (Team team in Enum.GetValues(typeof(Team))) { IsTileOn[team] = cell.IsTileOn[(int)team]; IsEnclosed[team] = cell.IsEnclosed[(int)team]; } Coordinate = new Coordinate(cell.Coordinate); }
/// <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]); } } }