From 64e7db9800304776bf484d499918df78eade7a7e Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Mon, 28 Aug 2023 14:01:09 +0200 Subject: [PATCH] Formatting of Game.cs. --- scenes/Game.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scenes/Game.cs b/scenes/Game.cs index 57a1421..df8a6b0 100644 --- a/scenes/Game.cs +++ b/scenes/Game.cs @@ -114,7 +114,8 @@ public class Game : Spatial _streamContainer.Connect("TileHovered", this, nameof(OnTileHovered)); _tileWorld.Connect("WorldGenerated", this, nameof(OnWorldGenerated)); _generateWorldButton.Connect("pressed", this, nameof(OnGenerateButton)); - _player.TaskQueueComponent.Connect("StartInteraction", _interactionSystem, nameof(_interactionSystem.OnStartInteraction)); + _player.TaskQueueComponent.Connect("StartInteraction", _interactionSystem, + nameof(_interactionSystem.OnStartInteraction)); _player.Connect("GoldCountChanged", this, nameof(OnGoldCountChanged)); // register entity events @@ -259,7 +260,7 @@ public class Game : Spatial { _player.InteractionComponent.EmitSignal("InteractionEnd"); } - + _player.TaskQueueComponent.Reset(); _player.TaskQueueComponent.Queue.Enqueue(new TaskQueueComponent.NavigationTask( new NavigationComponent.NavigationPoint(tile.GlobalTranslation))); @@ -273,7 +274,7 @@ public class Game : Spatial _mouseWorldLabel.Text = highlightTransform.origin.ToString(); _mouseTileOffsetLabel.Text = tile.OffsetCoords.ToString(); _mouseTileCubeLabel.Text = tile.Cell.CubeCoords.ToString(); - + _player.Navigation.FindPath(_player, _player.GlobalTranslation, tile.GlobalTranslation); } @@ -303,7 +304,7 @@ public class Game : Spatial playerStartTransform.basis.Quat()); _goldCountLabel.Text = "0"; - + foreach (Spatial entity in GetNode("Entities").GetChildren()) { Transform entityTransform = entity.Transform; @@ -320,14 +321,14 @@ public class Game : Spatial GD.Print("Using new map. Size: " + (int)_tileWorld.ColormapImage.GetSize().x); _goldCountLabel.Text = "0"; - + UpdateWorldTextures(); _streamContainer.OnWorldGenerated(); // Reset player transform to offset 0,0 and at current height ResetGameState(); - + // Connect all signals of the generated world foreach (Node node in _tileWorld.Entities.GetChildren()) { @@ -341,7 +342,7 @@ public class Game : Spatial private void UpdateWorldTextures() { GD.Print("Updating World textures"); - + ImageTexture newWorldTexture = new ImageTexture(); newWorldTexture.CreateFromImage(_tileWorld.ColormapImage, (uint)(Texture.FlagsEnum.Mipmaps | Texture.FlagsEnum.Repeat));