Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        engine = new HommEngine(new CommonEngine());

        var map   = new Map("Assets/goodMap.txt");
        var round = new Round("Assets/goodMap.txt", new string[] { "1", "2" });

        MapUnityConnecter.Connect(round, engine);
        engine.Move("1", Directions.Up);
        //var b = 0;
    }
Esempio n. 2
0
        public static void Connect(Round round, HommEngine e)
        {
            var map = round.map;

            engine = e;
            engine.SetCamera(map.Width, map.Height);
            engine.CreatePlayers(round.players.Select(p => p.Name).ToArray());
            for (int x = 0; x < map.Width; x++)
            {
                for (int y = 0; y < map.Height; y++)
                {
                    engine.CreateHexagon(GetHexagonType(map[y, x].tileTerrain), x, y);
                    CreateTileObject(map[y, x].tileObject);
                }
            }
        }
Esempio n. 3
0
        public static void Connect(Map map, HommEngine e, string[] players)
        {
            engine = e;

            playersColors[players[0]] = Color.red;
            playersColors[players[1]] = Color.blue;
            playersColors[""]         = Color.gray;

            engine.SetCamera(map.Width, map.Height);

            foreach (var location in Location.Square(map.Size))
            {
                CreateHexagon(map[location]);
                CreateTileObject(map[location].tileObject);
            }
        }