init new repos
This commit is contained in:
43
Assets/Code/GameState.cs
Normal file
43
Assets/Code/GameState.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameState : MonoBehaviour
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public string PlayerName { get; set; }
|
||||
public int Health { get; set; }
|
||||
public int Magic { get; set; }
|
||||
public int Level { get; set; }
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public bool IsPlayerControlLocked { get; set; }
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
private Dictionary<int, int> _storyVariables = new Dictionary<int, int>();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public List<int> Skills { get; set; } = new List<int>();
|
||||
public Dictionary<int, int> Inventory { get; set; } = new Dictionary<int, int>();
|
||||
|
||||
public void SetGlobalVariable(int address, int value)
|
||||
{
|
||||
_storyVariables[address] = value;
|
||||
Debug.Log($"Set global variable 0x{address:X8} = {value}");
|
||||
}
|
||||
|
||||
public int GetGlobalVariable(int address)
|
||||
{
|
||||
return _storyVariables.TryGetValue(address, out int value) ? value : 0;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_storyVariables.Clear();
|
||||
Skills.Clear();
|
||||
Inventory.Clear();
|
||||
Health = 100;
|
||||
Magic = 50;
|
||||
Level = 1;
|
||||
IsPlayerControlLocked = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user