コード例 #1
0
        public static void LoadHexFields(HexField[,] hexFields, ICollection <LineObject> lineObject, ICollection <Settlement> settlements, ContentManager content)
        {
            //10, 7
            hexFields[4, 1] = new HexField(DataGenerator.GenerateHexTerrain(), content, 285, 120, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(7, 1),
                GameClass.GetSettlementByPosition(8, 1),
                GameClass.GetSettlementByPosition(9, 1),
                GameClass.GetSettlementByPosition(7, 2),
                GameClass.GetSettlementByPosition(8, 2),
                GameClass.GetSettlementByPosition(9, 2)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(7, 1, 8, 1),
                GameClass.GetRoadByBothEnds(8, 1, 9, 1),
                GameClass.GetRoadByBothEnds(9, 1, 9, 2),
                GameClass.GetRoadByBothEnds(7, 1, 7, 2),
                GameClass.GetRoadByBothEnds(7, 2, 8, 2),
                GameClass.GetRoadByBothEnds(8, 2, 9, 2)
            });
            hexFields[5, 1] = new HexField(DataGenerator.GenerateHexTerrain(), content, 365, 120, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(9, 1),
                GameClass.GetSettlementByPosition(10, 1),
                GameClass.GetSettlementByPosition(11, 1),
                GameClass.GetSettlementByPosition(9, 2),
                GameClass.GetSettlementByPosition(10, 2),
                GameClass.GetSettlementByPosition(11, 2)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(9, 1, 10, 1),
                GameClass.GetRoadByBothEnds(10, 1, 11, 1),
                GameClass.GetRoadByBothEnds(11, 1, 11, 2),
                GameClass.GetRoadByBothEnds(9, 1, 9, 2),
                GameClass.GetRoadByBothEnds(9, 2, 10, 2),
                GameClass.GetRoadByBothEnds(10, 2, 11, 2)
            });
            hexFields[6, 1] = new HexField(DataGenerator.GenerateHexTerrain(), content, 445, 120, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(11, 1),
                GameClass.GetSettlementByPosition(12, 1),
                GameClass.GetSettlementByPosition(13, 1),
                GameClass.GetSettlementByPosition(11, 2),
                GameClass.GetSettlementByPosition(12, 2),
                GameClass.GetSettlementByPosition(13, 2)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(11, 1, 12, 1),
                GameClass.GetRoadByBothEnds(12, 1, 13, 1),
                GameClass.GetRoadByBothEnds(13, 1, 13, 2),
                GameClass.GetRoadByBothEnds(11, 1, 11, 2),
                GameClass.GetRoadByBothEnds(11, 2, 12, 2),
                GameClass.GetRoadByBothEnds(12, 2, 13, 2)
            });

            hexFields[3, 2] = new HexField(DataGenerator.GenerateHexTerrain(), content, 245, 190, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(6, 2),
                GameClass.GetSettlementByPosition(7, 2),
                GameClass.GetSettlementByPosition(8, 2),
                GameClass.GetSettlementByPosition(6, 3),
                GameClass.GetSettlementByPosition(7, 3),
                GameClass.GetSettlementByPosition(8, 3)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(6, 2, 7, 2),
                GameClass.GetRoadByBothEnds(7, 2, 8, 2),
                GameClass.GetRoadByBothEnds(8, 2, 8, 3),
                GameClass.GetRoadByBothEnds(6, 2, 6, 3),
                GameClass.GetRoadByBothEnds(6, 3, 7, 3),
                GameClass.GetRoadByBothEnds(7, 3, 8, 3)
            });
            hexFields[4, 2] = new HexField(DataGenerator.GenerateHexTerrain(), content, 325, 190, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(8, 2),
                GameClass.GetSettlementByPosition(9, 2),
                GameClass.GetSettlementByPosition(10, 2),
                GameClass.GetSettlementByPosition(8, 3),
                GameClass.GetSettlementByPosition(9, 3),
                GameClass.GetSettlementByPosition(10, 3)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(8, 2, 9, 2),
                GameClass.GetRoadByBothEnds(9, 2, 10, 2),
                GameClass.GetRoadByBothEnds(10, 2, 10, 3),
                GameClass.GetRoadByBothEnds(8, 2, 8, 3),
                GameClass.GetRoadByBothEnds(8, 3, 9, 3),
                GameClass.GetRoadByBothEnds(9, 3, 10, 3)
            });
            hexFields[5, 2] = new HexField(DataGenerator.GenerateHexTerrain(), content, 405, 190, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(10, 2),
                GameClass.GetSettlementByPosition(11, 2),
                GameClass.GetSettlementByPosition(12, 2),
                GameClass.GetSettlementByPosition(10, 3),
                GameClass.GetSettlementByPosition(11, 3),
                GameClass.GetSettlementByPosition(12, 3)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(10, 2, 11, 2),
                GameClass.GetRoadByBothEnds(11, 2, 12, 2),
                GameClass.GetRoadByBothEnds(12, 2, 12, 3),
                GameClass.GetRoadByBothEnds(10, 2, 10, 3),
                GameClass.GetRoadByBothEnds(10, 3, 11, 3),
                GameClass.GetRoadByBothEnds(11, 3, 12, 3)
            });
            hexFields[6, 2] = new HexField(DataGenerator.GenerateHexTerrain(), content, 485, 190, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(12, 2),
                GameClass.GetSettlementByPosition(13, 2),
                GameClass.GetSettlementByPosition(14, 2),
                GameClass.GetSettlementByPosition(12, 3),
                GameClass.GetSettlementByPosition(13, 3),
                GameClass.GetSettlementByPosition(14, 3)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(12, 2, 13, 2),
                GameClass.GetRoadByBothEnds(13, 2, 14, 2),
                GameClass.GetRoadByBothEnds(14, 2, 14, 3),
                GameClass.GetRoadByBothEnds(12, 2, 12, 3),
                GameClass.GetRoadByBothEnds(12, 3, 13, 3),
                GameClass.GetRoadByBothEnds(13, 3, 14, 3)
            });

            hexFields[3, 3] = new HexField(DataGenerator.GenerateHexTerrain(), content, 205, 260, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(5, 3),
                GameClass.GetSettlementByPosition(6, 3),
                GameClass.GetSettlementByPosition(7, 3),
                GameClass.GetSettlementByPosition(5, 4),
                GameClass.GetSettlementByPosition(6, 4),
                GameClass.GetSettlementByPosition(7, 4)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(5, 3, 6, 3),
                GameClass.GetRoadByBothEnds(6, 3, 7, 3),
                GameClass.GetRoadByBothEnds(7, 3, 7, 4),
                GameClass.GetRoadByBothEnds(5, 3, 5, 4),
                GameClass.GetRoadByBothEnds(5, 4, 6, 4),
                GameClass.GetRoadByBothEnds(6, 4, 7, 4)
            });
            hexFields[4, 3] = new HexField(DataGenerator.GenerateHexTerrain(), content, 285, 260, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(7, 3),
                GameClass.GetSettlementByPosition(8, 3),
                GameClass.GetSettlementByPosition(9, 3),
                GameClass.GetSettlementByPosition(7, 4),
                GameClass.GetSettlementByPosition(8, 4),
                GameClass.GetSettlementByPosition(9, 4)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(7, 3, 8, 3),
                GameClass.GetRoadByBothEnds(8, 3, 9, 3),
                GameClass.GetRoadByBothEnds(9, 3, 9, 4),
                GameClass.GetRoadByBothEnds(7, 3, 7, 4),
                GameClass.GetRoadByBothEnds(7, 4, 8, 4),
                GameClass.GetRoadByBothEnds(8, 4, 9, 4)
            });
            hexFields[5, 3] = new HexField(TerrainType.Desert, content, 365, 260, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(9, 3),
                GameClass.GetSettlementByPosition(10, 3),
                GameClass.GetSettlementByPosition(11, 3),
                GameClass.GetSettlementByPosition(9, 4),
                GameClass.GetSettlementByPosition(10, 4),
                GameClass.GetSettlementByPosition(11, 4)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(9, 3, 10, 3),
                GameClass.GetRoadByBothEnds(10, 3, 11, 3),
                GameClass.GetRoadByBothEnds(11, 3, 11, 4),
                GameClass.GetRoadByBothEnds(9, 3, 9, 4),
                GameClass.GetRoadByBothEnds(9, 4, 10, 4),
                GameClass.GetRoadByBothEnds(10, 4, 11, 4)
            });
            hexFields[6, 3] = new HexField(DataGenerator.GenerateHexTerrain(), content, 445, 260, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(11, 3),
                GameClass.GetSettlementByPosition(12, 3),
                GameClass.GetSettlementByPosition(13, 3),
                GameClass.GetSettlementByPosition(11, 4),
                GameClass.GetSettlementByPosition(12, 4),
                GameClass.GetSettlementByPosition(13, 4)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(11, 3, 12, 3),
                GameClass.GetRoadByBothEnds(12, 3, 13, 3),
                GameClass.GetRoadByBothEnds(13, 3, 13, 4),
                GameClass.GetRoadByBothEnds(11, 3, 11, 4),
                GameClass.GetRoadByBothEnds(11, 4, 12, 4),
                GameClass.GetRoadByBothEnds(12, 4, 13, 4)
            });
            hexFields[7, 3] = new HexField(DataGenerator.GenerateHexTerrain(), content, 525, 260, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(13, 3),
                GameClass.GetSettlementByPosition(14, 3),
                GameClass.GetSettlementByPosition(15, 3),
                GameClass.GetSettlementByPosition(13, 4),
                GameClass.GetSettlementByPosition(14, 4),
                GameClass.GetSettlementByPosition(15, 4)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(13, 3, 14, 3),
                GameClass.GetRoadByBothEnds(14, 3, 15, 3),
                GameClass.GetRoadByBothEnds(15, 3, 15, 4),
                GameClass.GetRoadByBothEnds(13, 3, 13, 4),
                GameClass.GetRoadByBothEnds(13, 4, 14, 4),
                GameClass.GetRoadByBothEnds(14, 4, 15, 4)
            });

            hexFields[3, 4] = new HexField(DataGenerator.GenerateHexTerrain(), content, 245, 330, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(6, 4),
                GameClass.GetSettlementByPosition(7, 4),
                GameClass.GetSettlementByPosition(8, 4),
                GameClass.GetSettlementByPosition(6, 5),
                GameClass.GetSettlementByPosition(7, 5),
                GameClass.GetSettlementByPosition(8, 5)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(6, 4, 7, 4),
                GameClass.GetRoadByBothEnds(7, 4, 8, 4),
                GameClass.GetRoadByBothEnds(8, 4, 8, 5),
                GameClass.GetRoadByBothEnds(6, 4, 6, 5),
                GameClass.GetRoadByBothEnds(6, 5, 7, 5),
                GameClass.GetRoadByBothEnds(7, 5, 8, 5)
            });
            hexFields[4, 4] = new HexField(DataGenerator.GenerateHexTerrain(), content, 325, 330, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(8, 4),
                GameClass.GetSettlementByPosition(9, 4),
                GameClass.GetSettlementByPosition(10, 4),
                GameClass.GetSettlementByPosition(8, 5),
                GameClass.GetSettlementByPosition(9, 5),
                GameClass.GetSettlementByPosition(10, 5)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(8, 4, 9, 4),
                GameClass.GetRoadByBothEnds(9, 4, 10, 4),
                GameClass.GetRoadByBothEnds(10, 4, 10, 5),
                GameClass.GetRoadByBothEnds(8, 4, 8, 5),
                GameClass.GetRoadByBothEnds(8, 5, 9, 5),
                GameClass.GetRoadByBothEnds(9, 5, 10, 5)
            });
            hexFields[5, 4] = new HexField(DataGenerator.GenerateHexTerrain(), content, 405, 330, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(10, 4),
                GameClass.GetSettlementByPosition(11, 4),
                GameClass.GetSettlementByPosition(12, 4),
                GameClass.GetSettlementByPosition(10, 5),
                GameClass.GetSettlementByPosition(11, 5),
                GameClass.GetSettlementByPosition(12, 5)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(10, 4, 11, 4),
                GameClass.GetRoadByBothEnds(11, 4, 12, 4),
                GameClass.GetRoadByBothEnds(12, 4, 12, 5),
                GameClass.GetRoadByBothEnds(10, 4, 10, 5),
                GameClass.GetRoadByBothEnds(10, 5, 11, 5),
                GameClass.GetRoadByBothEnds(11, 5, 12, 5)
            });
            hexFields[6, 4] = new HexField(DataGenerator.GenerateHexTerrain(), content, 485, 330, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(12, 4),
                GameClass.GetSettlementByPosition(13, 4),
                GameClass.GetSettlementByPosition(14, 4),
                GameClass.GetSettlementByPosition(12, 5),
                GameClass.GetSettlementByPosition(13, 5),
                GameClass.GetSettlementByPosition(14, 5)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(12, 4, 13, 4),
                GameClass.GetRoadByBothEnds(13, 4, 14, 4),
                GameClass.GetRoadByBothEnds(14, 4, 14, 5),
                GameClass.GetRoadByBothEnds(12, 4, 12, 5),
                GameClass.GetRoadByBothEnds(12, 5, 13, 5),
                GameClass.GetRoadByBothEnds(13, 5, 14, 5)
            });

            hexFields[4, 5] = new HexField(DataGenerator.GenerateHexTerrain(), content, 285, 400, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(7, 5),
                GameClass.GetSettlementByPosition(8, 5),
                GameClass.GetSettlementByPosition(9, 5),
                GameClass.GetSettlementByPosition(7, 6),
                GameClass.GetSettlementByPosition(8, 6),
                GameClass.GetSettlementByPosition(9, 6)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(7, 5, 8, 5),
                GameClass.GetRoadByBothEnds(8, 5, 9, 5),
                GameClass.GetRoadByBothEnds(9, 5, 9, 6),
                GameClass.GetRoadByBothEnds(7, 5, 7, 6),
                GameClass.GetRoadByBothEnds(7, 6, 8, 6),
                GameClass.GetRoadByBothEnds(8, 6, 9, 6)
            });
            hexFields[5, 5] = new HexField(DataGenerator.GenerateHexTerrain(), content, 365, 400, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(8, 5),
                GameClass.GetSettlementByPosition(9, 5),
                GameClass.GetSettlementByPosition(10, 5),
                GameClass.GetSettlementByPosition(8, 6),
                GameClass.GetSettlementByPosition(9, 6),
                GameClass.GetSettlementByPosition(10, 6)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(8, 5, 9, 5),
                GameClass.GetRoadByBothEnds(9, 5, 10, 5),
                GameClass.GetRoadByBothEnds(10, 5, 10, 6),
                GameClass.GetRoadByBothEnds(8, 5, 8, 6),
                GameClass.GetRoadByBothEnds(8, 6, 9, 6),
                GameClass.GetRoadByBothEnds(9, 6, 10, 6)
            });
            hexFields[6, 5] = new HexField(DataGenerator.GenerateHexTerrain(), content, 445, 400, 70, 80,
                                           new List <NodeObject> {
                GameClass.GetSettlementByPosition(10, 5),
                GameClass.GetSettlementByPosition(11, 5),
                GameClass.GetSettlementByPosition(12, 5),
                GameClass.GetSettlementByPosition(10, 6),
                GameClass.GetSettlementByPosition(11, 6),
                GameClass.GetSettlementByPosition(12, 6)
            },
                                           new List <LineObject> {
                GameClass.GetRoadByBothEnds(10, 5, 11, 5),
                GameClass.GetRoadByBothEnds(11, 5, 12, 5),
                GameClass.GetRoadByBothEnds(12, 5, 12, 6),
                GameClass.GetRoadByBothEnds(10, 5, 10, 6),
                GameClass.GetRoadByBothEnds(10, 6, 11, 6),
                GameClass.GetRoadByBothEnds(11, 6, 12, 6)
            });
        }