Advertisement
Nighticus

Untitled

Nov 21st, 2021
1,520
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private void ActivateScenario(string ScenarioName)
  2.         {
  3.  
  4.             // Load default character first
  5.             String[] ScenarioData = LoadScenarioData(ScenarioName);
  6.            
  7.             string CurrentHeader = "";
  8.             string CurrentAddress = "";
  9.             string CurrentData = "";
  10.             foreach (string Line in ScenarioData)
  11.             {
  12.                 if (Line.StartsWith("[") && Line.EndsWith("_Start]"))
  13.                 {
  14.                     CurrentHeader = Line.Split('[')[1].Split('_')[0];
  15.                     CurrentAddress = "";
  16.                     CurrentData = "";
  17.                 }
  18.                 else if (Line.Contains("="))
  19.                 {
  20.                     CurrentAddress = Line.Split('=')[0];
  21.                     CurrentData = Line.Split('=')[1];
  22.                 }
  23.                 SetScenarioData(CurrentHeader, CurrentAddress, CurrentData);
  24.             }
  25.         }
Advertisement
RAW Paste Data Copied
Advertisement