POLITICS!! + Debugging Hell v2
I mean I guess it is? Not too sure.
Event Manager completely overhauled. Double events now no longer have the chance of repeating the same event.
Created a new GameEffects script which just takes a bunch of simple code away from EventManager and plays the basic functions such as the “tax revenue increases” which you see below.
This was quite a headache to create, and I severely underestimated how much time this would take. I have 2 extra nested classes inside of EventManager for Political Question and Political Scenario.
[... inside EventManager.cs ...]
public class PoliticalQuestion
{
public string Question;
public TaskCompletionSource<bool> TaskCompletionSource = new TaskCompletionSource<bool>();
public Action onAccept;
public PoliticalQuestion(string question, Action onAccept)
{
Question = question;
this.onAccept = onAccept;
}
}
public class PoliticalScenario
{
public string description;
public Action runnable;
public PoliticalScenario(string featureDescription, Action functionality)
{
description = featureDescription;
runnable = functionality;
}
}
[Header("Political Question Variables")]
public List<PoliticalQuestion> PendingQuestions = new List<PoliticalQuestion>();
public event Action onQueueChanged;
private PoliticalScenario[] goodFeatures;
private PoliticalScenario[] badFeatures;
The political question is sent off to the UI manager, which displays it as shown below. Then it handles user input pressing Y/Enter or N/Esc to accept the user choice, and returns it back to the Event Manager. Seems simple enough, yet there are many ways to do it but I think that the above implementation works the best out of all the ones that I tried. I attempted to use Game Manager as a middleman but that did not work out - so I resorted to passing an entire class.
The political scenario allows for the string to actually do something, so that the game knows what to process and what the user agreed to without creating a bunch of variables, and can allow for stacked political question events which is nice.
Game’s looking really neat, and the multipliers and stuff can make the game go very crazy very quickly.
Too much of a good thing is a bad thing!!
Debugged the entire system for like a solid 3 hours it was actually bad.
Came first in the UK tho!! I’m back after those 6 exams are done.
Yes I know the UI looks pretty bad but it’s good enough for pre-beta testing.
Oh yeah, speaking of UI everything is more bold. Figured out how to do that.