it's michael, what's michael

This commit is contained in:
2024-09-15 02:17:40 -07:00
parent 096bcd6168
commit 7680ab8b45
313 changed files with 6913 additions and 1760 deletions

View File

@@ -9,6 +9,8 @@ using Godot;
public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvide<IGame>, INode3D
{
event Game.StatRaisedAlertEventHandler StatRaisedAlert;
public IPlayer Player { get; }
}
[Meta(typeof(IAutoNode))]

View File

@@ -36,6 +36,9 @@ namespace GameJamDungeon
event Action<ConsumableItemStats>? HealingItemConsumed;
public void OnHealingItemConsumed(ConsumableItemStats item);
event Action<EnemyStatResource>? EnemyDefeated;
public void OnEnemyDefeated(EnemyStatResource enemyStatResource);
}
public class GameEventDepot : IGameEventDepot
@@ -54,6 +57,7 @@ namespace GameJamDungeon
public event Action? UnequippedItem;
public event Action? InventorySorted;
public event Action<ConsumableItemStats>? HealingItemConsumed;
public event Action<EnemyStatResource>? EnemyDefeated;
public void OnOverworldEntered() => OverworldEntered?.Invoke();
public void OnDungeonAThemeAreaEntered() => DungeonAThemeAreaEntered?.Invoke();
@@ -69,6 +73,8 @@ namespace GameJamDungeon
public void OnInventorySorted() => InventorySorted?.Invoke();
public void OnHealingItemConsumed(ConsumableItemStats item) => HealingItemConsumed?.Invoke(item);
public void OnEnemyDefeated(EnemyStatResource enemyStatResource) => EnemyDefeated?.Invoke(enemyStatResource);
public void Dispose()
{
GC.SuppressFinalize(this);

View File

@@ -14,12 +14,16 @@ public interface IGameRepo : IDisposable
IAutoProp<Vector3> PlayerGlobalPosition { get; }
IAutoProp<Transform3D> PlayerGlobalTransform { get; }
PlayerData PlayerData { get; }
public void SetPlayerData(PlayerData playerData);
void SetPlayerGlobalPosition(Vector3 playerGlobalPosition);
void SetPlayerGlobalTransform(Transform3D playerGlobalTransform);
public int MaxItemSize { get; }
public int CurrentFloor { get; set; }
@@ -32,6 +36,9 @@ public class GameRepo : IGameRepo
public IAutoProp<Vector3> PlayerGlobalPosition => _playerGlobalPosition;
private readonly AutoProp<Vector3> _playerGlobalPosition;
public IAutoProp<Transform3D> PlayerGlobalTransform => _playerGlobalTransform;
private readonly AutoProp<Transform3D> _playerGlobalTransform;
public IAutoProp<bool> IsPaused => _isPaused;
private readonly AutoProp<bool> _isPaused;
@@ -48,6 +55,7 @@ public class GameRepo : IGameRepo
{
_isPaused = new AutoProp<bool>(false);
_playerGlobalPosition = new AutoProp<Vector3>(Vector3.Zero);
_playerGlobalTransform = new AutoProp<Transform3D>(Transform3D.Identity);
}
public void Pause()
@@ -64,6 +72,8 @@ public class GameRepo : IGameRepo
public void SetPlayerGlobalPosition(Vector3 playerGlobalPosition) => _playerGlobalPosition.OnNext(playerGlobalPosition);
public void SetPlayerGlobalTransform(Transform3D playerGlobalTransform) => _playerGlobalTransform.OnNext(playerGlobalTransform);
public void SetPlayerData(PlayerData playerData) => _playerData = playerData;
public void OnGameEnded()