From 42ce4d17dfb8d28b4806d909cf3900ae65f350bd Mon Sep 17 00:00:00 2001 From: Jenique Peters <42607744+JeniquePeters@users.noreply.github.com> Date: Sun, 21 Aug 2022 12:50:51 +0200 Subject: [PATCH] 2022.3.9 --- game-engine/Engine/.gitlab-ci.yml | 2 +- game-engine/Engine/Services/TerritoryService.cs | 3 +-- game-engine/Engine/Services/WorldStateService.cs | 6 +++++- game-engine/GameRunner/.gitlab-ci.yml | 2 +- game-engine/Logger/.gitlab-ci.yml | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/game-engine/Engine/.gitlab-ci.yml b/game-engine/Engine/.gitlab-ci.yml index 7c791fe..8bc1c6d 100644 --- a/game-engine/Engine/.gitlab-ci.yml +++ b/game-engine/Engine/.gitlab-ci.yml @@ -3,7 +3,7 @@ # - deploy variables: - ENGINE_VERSION: 2022.3.8 + ENGINE_VERSION: 2022.3.9 # DOCKER_REGISTRY: NOT_SET # REGION: $AWS_DEFAULT_REGION diff --git a/game-engine/Engine/Services/TerritoryService.cs b/game-engine/Engine/Services/TerritoryService.cs index 577bbef..e802034 100644 --- a/game-engine/Engine/Services/TerritoryService.cs +++ b/game-engine/Engine/Services/TerritoryService.cs @@ -125,7 +125,6 @@ private bool PositionIsClaimable(Position position) private void CreateNewLand(BotObject bot, Position position) { var containedNode = worldStateService.NodeByPosition(position); - var land = new Land(position, bot.BotId, containedNode.Id); if (containedNode == null) { @@ -133,6 +132,7 @@ private void CreateNewLand(BotObject bot, Position position) return; } + var land = new Land(position, bot.BotId, containedNode.Id); LandByPosition[containedNode.Position] = land; LandByNodeId[containedNode.Id] = land; AddOccupantsToLand(land, bot, 0); @@ -147,7 +147,6 @@ private List CreateAvailableNodes(BotObject bot, List t var positionsInUse = worldStateService.GetPositionsInUse(); var availablePositionsInTerritory = territoryPositions.Where(position => !positionsInUse.Contains(position)).ToList(); var availableNodes = availablePositionsInTerritory.Select(position => new AvailableNode(position){MaxUnits = 10 /*Is this necessary??*/}).ToList(); - positionsInUse.UnionWith(availablePositionsInTerritory); worldStateService.AddAvailableNodes(availableNodes); bot.AddAvailableNodeIds(availableNodes.Select(node => node.Id)); diff --git a/game-engine/Engine/Services/WorldStateService.cs b/game-engine/Engine/Services/WorldStateService.cs index cebee9e..be0c8f7 100644 --- a/game-engine/Engine/Services/WorldStateService.cs +++ b/game-engine/Engine/Services/WorldStateService.cs @@ -124,7 +124,11 @@ public void RemoveAvailableNode(Guid availableNodeId) public void AddAvailableNodes(List buildingNodes) { state.World.Map.AvailableNodes.AddRange(buildingNodes); - buildingNodes.ForEach(node => NodesByPosition[node.Position] = node); + buildingNodes.ForEach(node => + { + NodesByPosition[node.Position] = node; + positionsInUse.Add(node.Position); + }); } public Position GetNextBotPosition() diff --git a/game-engine/GameRunner/.gitlab-ci.yml b/game-engine/GameRunner/.gitlab-ci.yml index debc6ee..6ba5076 100644 --- a/game-engine/GameRunner/.gitlab-ci.yml +++ b/game-engine/GameRunner/.gitlab-ci.yml @@ -3,7 +3,7 @@ # - deploy variables: - RUNNER_VERSION: 2022.3.8 + RUNNER_VERSION: 2022.3.9 # DOCKER_REGISTRY: NOT_SET # REGION: $AWS_DEFAULT_REGION diff --git a/game-engine/Logger/.gitlab-ci.yml b/game-engine/Logger/.gitlab-ci.yml index da8779d..81c8d57 100644 --- a/game-engine/Logger/.gitlab-ci.yml +++ b/game-engine/Logger/.gitlab-ci.yml @@ -3,7 +3,7 @@ # - deploy variables: - LOGGER_VERSION: 2022.3.8 + LOGGER_VERSION: 2022.3.9 # DOCKER_REGISTRY: NOT_SET # REGION: $AWS_DEFAULT_REGION