Пример #1
0
        public void Start()
        {
            myWindow.parentCloseCallback = CloseWindow;
            if (PlayerGameManager.GetInstance != null)
            {
                if (PlayerGameManager.GetInstance.campaignData.mapPointList == null)
                {
                    PlayerGameManager.GetInstance.campaignData.mapPointList = new List <MapPointInformationData>();
                }

                MapPointInformationData checkIfTheresEmptyLand = PlayerGameManager.GetInstance.campaignData.mapPointList.Find(x => x.ownedBy == TerritoryOwners.Neutral);
                if (PlayerGameManager.GetInstance.campaignData.mapPointList.Count <= 0 ||
                    checkIfTheresEmptyLand != null && (checkIfTheresEmptyLand.troopsStationed == null || checkIfTheresEmptyLand.troopsStationed.Count <= 0))
                {
                    for (int i = 0; i < mapSelectionList.Count; i++)
                    {
                        currentMap = mapSelectionList[i];
                        if (currentMap.myMap.myMapPoints.Find(x => x.myPointInformation.ownedBy == TerritoryOwners.Neutral &&
                                                              (x.myPointInformation.troopsStationed == null || x.myPointInformation.troopsStationed.Count <= 0)))
                        {
                            GenerateMapUnits();
                        }
                    }
                    SaveMapUnits();
                }
                else
                {
                    InitializeMapUnits();
                }
            }
        }
Пример #2
0
        public void LoadMapPointInformation(MapPointInformationData mapPointInformationData)
        {
            myPointInformation         = new MapPointInformationData();
            myPointInformation         = mapPointInformationData;
            myPointInformation.mapType = myController.mapType;
            UpdateFlagCrest();

            if (myPointInformation.travellersOnPoint != null && myPointInformation.travellersOnPoint.Count > 0 && !pointTowardsKingdom)
            {
                RandomizeTravellerMovement();
            }
            else if (pointTowardsKingdom && myPointInformation.travellersOnPoint != null && myPointInformation.travellersOnPoint.Count > 0)
            {
                if (myPointInformation.latestWeekUpdated != PlayerGameManager.GetInstance.playerData.weekCount)
                {
                    SpawnThisTravelerUnitToVisibleMap(myPointInformation.travellersOnPoint[0], myPointInformation.mapType);
                    myPointInformation.travellersOnPoint.RemoveAt(0);
                }
            }

            if (myPointInformation.travellersOnPoint.Find(x => x.numberOfMovesNextWeek > 0) != null)
            {
                StartCoroutine(DelayWeekTravel());
            }

            myPointInformation.latestWeekUpdated = PlayerGameManager.GetInstance.playerData.weekCount;
        }