PseudoCode Missions - Milowan/WarChildPort GitHub Wiki

Mission

bool unlocked

bool completed

Mission next

Mission prev

string name

Mission(string, bool = false, Mission = null)

Set name to string.

Set unlocked to bool.

Set completed to false.

Set prev to Mission

If prev is not null,

Execute prev's SetNext function with parameter: this.

If prev is completed,

  Execute the Unlock function.

void SetNext(Mission)

Set next to nMission.

void Complete

Set completed to true.

If next is not null,

Execute next's Unlock function.

void Unlock

Set unlocked to true.

string GetName

Return name.

MissionData

static List missions

static void AddToList(Mission)

If missions is null,

Set missions to new List.

Execute mission's Add function with parameter: AddToList's function parameter.

static void Save

If missions is null,

Set missions to new List.

Set local Filestream to new saveFile.

Set local BinaryFormatter to new BinaryFormatter.

Execute the formatter's Serialize function with the parameters: stream, missions.

Execute the stream's Close function.

static void Load

If missions is null,

Set missions to new List.

If a saveFile exists,

Set local Filestream to existing saveFile.

Set local BinaryFormatter to new BinaryFormatter.

Set missions to formatter's Deserialize with parameter: stream, cast as List.

Initializer -> AActor

void Start

Execute the MissionData's Load function.

If missions count is 0,

Execute GenerateMissions function.

Unreal version of loading the Unreal version of the "scene": MainMenu.

void GenerateMissions

Execute MissionData's AddToList with parameters:

new Mission: Defense, true.

Execute MissionData's AddToList with parameters:

new Mission: Exterminate, false, missions[0].

⚠️ **GitHub.com Fallback** ⚠️