Preserve current state before big refactor
This commit is contained in:
@@ -2,34 +2,11 @@
|
||||
namespace GameJamDungeon;
|
||||
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.SaveFileBuilder;
|
||||
using GameJamDungeon.src.item_rescue;
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvide<IGame>, INode3D
|
||||
{
|
||||
event Game.StatRaisedAlertEventHandler StatRaisedAlert;
|
||||
|
||||
public IPlayer Player { get; }
|
||||
|
||||
public RescuedItemDatabase RescuedItems { get; }
|
||||
|
||||
public void DropItem(IInventoryItem item);
|
||||
|
||||
public void ThrowItem(IInventoryItem item);
|
||||
|
||||
public void HealHP(int amountToRaise);
|
||||
public void RaiseHP(int amountToRaise);
|
||||
|
||||
public void HealVT(int amountToRaise);
|
||||
public void RaiseVT(int amountToRaise);
|
||||
|
||||
public void DoubleEXP(TimeSpan lengthOfEffect);
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Game : Node3D, IGame
|
||||
{
|
||||
@@ -151,12 +128,20 @@ public partial class Game : Node3D, IGame
|
||||
Player.MinimapButtonHeld += Player_MinimapButtonHeld;
|
||||
Player.PauseButtonPressed += Player_PauseButtonPressed;
|
||||
|
||||
GameRepo.PlayerData.CurrentHP.Sync += CurrentHP_Sync;
|
||||
|
||||
GameEventDepot.EnemyDefeated += OnEnemyDefeated;
|
||||
GameEventDepot.RestorativePickedUp += GameEventDepot_RestorativePickedUp;
|
||||
|
||||
DoubleEXPTimer.Timeout += DoubleEXPTimer_Timeout;
|
||||
}
|
||||
|
||||
private void CurrentHP_Sync(int currentHP)
|
||||
{
|
||||
if (currentHP <= 0)
|
||||
GameLogic.Input(new GameLogic.Input.GameOver());
|
||||
}
|
||||
|
||||
private void Inventory_PickedUpItem(string pickedUpItemName)
|
||||
{
|
||||
InGameUI.PlayerInfoUI.DisplayMessage($"{pickedUpItemName} picked up.");
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
@startuml GameLogic
|
||||
state "GameLogic State" as GameJamDungeon_GameLogic_State {
|
||||
state "GameStarted" as GameJamDungeon_GameLogic_State_GameStarted
|
||||
state "Quit" as GameJamDungeon_GameLogic_State_Quit
|
||||
state "Playing" as GameJamDungeon_GameLogic_State_Playing {
|
||||
state "AskForTeleport" as GameJamDungeon_GameLogic_State_AskForTeleport
|
||||
state "FloorClearedDecisionState" as GameJamDungeon_GameLogic_State_FloorClearedDecisionState
|
||||
state "InventoryOpened" as GameJamDungeon_GameLogic_State_InventoryOpened
|
||||
state "MinimapOpen" as GameJamDungeon_GameLogic_State_MinimapOpen
|
||||
state "Paused" as GameJamDungeon_GameLogic_State_Paused
|
||||
state "FloorClearedDecisionState" as GameJamDungeon_GameLogic_State_FloorClearedDecisionState
|
||||
state "AskForTeleport" as GameJamDungeon_GameLogic_State_AskForTeleport
|
||||
state "InventoryOpened" as GameJamDungeon_GameLogic_State_InventoryOpened
|
||||
state "Resuming" as GameJamDungeon_GameLogic_State_Resuming
|
||||
}
|
||||
state "Quit" as GameJamDungeon_GameLogic_State_Quit
|
||||
state "GameStarted" as GameJamDungeon_GameLogic_State_GameStarted
|
||||
}
|
||||
|
||||
GameJamDungeon_GameLogic_State_AskForTeleport --> GameJamDungeon_GameLogic_State_FloorClearedDecisionState : FloorExitReached
|
||||
|
||||
28
src/game/IGame.cs
Normal file
28
src/game/IGame.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
namespace GameJamDungeon;
|
||||
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using GameJamDungeon.src.item_rescue;
|
||||
using System;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvide<IGame>, INode3D
|
||||
{
|
||||
event Game.StatRaisedAlertEventHandler StatRaisedAlert;
|
||||
|
||||
public IPlayer Player { get; }
|
||||
|
||||
public RescuedItemDatabase RescuedItems { get; }
|
||||
|
||||
public void DropItem(IInventoryItem item);
|
||||
|
||||
public void ThrowItem(IInventoryItem item);
|
||||
|
||||
public void HealHP(int amountToRaise);
|
||||
public void RaiseHP(int amountToRaise);
|
||||
|
||||
public void HealVT(int amountToRaise);
|
||||
public void RaiseVT(int amountToRaise);
|
||||
|
||||
public void DoubleEXP(TimeSpan lengthOfEffect);
|
||||
}
|
||||
Reference in New Issue
Block a user