initialize repo

This commit is contained in:
2025-08-08 15:36:09 +02:00
parent d6a2c37a5f
commit cabf13d164
92 changed files with 2160 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
using System.Linq;
using Civilization.Core.Game;
using Civilization.Core.Units;
using Godot;
namespace Civilization.GodotIntegration;
public partial class SelectionSystem : Node2D
{
public Unit? SelectedUnit { get; private set; }
[Export] public SelectedUnitPanel UnitPanel;
public bool TrySelectUnitAt(Vector2I tilePos, GameState state)
{
var unit = state.GetUnitsForPlayer(state.CurrentPlayer.Id).FirstOrDefault(u => u.Position == tilePos);
if (unit == null) return false;
SelectedUnit = unit;
GD.Print($"Selected unit {unit.Id} at {tilePos} ({unit.Type})");
UnitPanel.ShowFor(unit);
return true;
}
public void Deselect()
{
SelectedUnit = null;
UnitPanel.HidePanel();
}
}