Example #1
0
        public void AddNavigator(Vector3Int pos, Player owner, Vector3Int gridpos)
        {
            var vacantSlot = !Map.Maps.NavigatorsMap.ContainsKey(IlluminaConverter.ToCoordInt(pos));
            var hasRights  = (int)owner.tribe == GamePlayManager.PlayerTurn;

            if (vacantSlot && hasRights && owner.navigators.Count < 3)
            {
                var flipX = false;
                if (pos.y < gridpos.y)
                {
                    flipX = true;
                }
                var navigator = new Navigator(owner, pos, flipX);
                Map.PlaceNavigator(pos, navigator);
                PlaceNavigator(navigator, flipX);
                PlayDataController.SavePlayData();
            }
        }
    void CreateGameWorld()
    {
        var collections = this.gameObject.GetComponent <GameAssetsCollection>();

        world = new World(collections.ToWorldCollection());
        // if (GameData.PlayData.old) {
        //     world.Map = GameData.PlayData.worldMap;
        // }
        if (GameData.PlayData.old)
        {
            world.CreateNew();
            var data = new PlayData();
            data.worldMap           = this.world.Map;
            PlayDataController.Data = data;
            PlayDataController.SavePlayData();
        }
        world.Render();
    }