Skip to content

Commit

Permalink
Add offsets for every level
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver2Goetz committed Mar 5, 2024
1 parent 22b4742 commit f1fd920
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 3 deletions.
3 changes: 3 additions & 0 deletions AIUtils/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ private void comboboxLevels_SelectedIndexChanged(object sender, EventArgs e) {
private List<String> getLevels() {
List<String> levels = new List<String>() {
"-",
"ENG_REACTOR_CORE (PT1)",
"HAB_AIRPORT (M17)",
"HAB_CORPORATEPENT",
"SCI_HOSPITALUPPER"
};

Expand Down
63 changes: 60 additions & 3 deletions AIUtils/LevelCalculation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,38 @@ class LevelCalculation {
public static Level calculateLevel(Level level) {
Level calculatedLevel = null;

// todo calculate the new coordinates for each
switch(level.name) {
case "ENG_REACTOR_CORE (PT1)":
calculatedLevel = calculateEngReactorCorePt1(level);
break;
case "HAB_AIRPORT (M17)":
calculatedLevel = calculateHabAirportM1(level);
break;

case "HAB_CORPORATEPENT":
calculatedLevel = calculateHabCorporatepent(level);
break;

case "SCI_HOSPITALUPPER":
calculatedLevel = calculateSciHospitalUpper(level);
break;

// List of levels without offsets
// These levels will not be shown in the select field
case "BSP_LV426_PT01":
case "BSP_LV426_PT02":
case "BSP_TORRENS":
case "ENG_TOWPLATFORM":
case "HAB_SHOPPINGCENTRE":
case "SCI_ANDROIDLAB":
case "SCI_HOSPITALLOWER":
case "SCI_HUB":
case "SOLACE":
case "TECH_COMMS":
case "TECH_HUB":
case "TECH_MUTHRCORE":
case "TECH_RND":
case "TECH_RND_HZDLAB":
case "-":
case "":
default:
Expand All @@ -25,13 +49,46 @@ public static Level calculateLevel(Level level) {
return calculatedLevel;
}

private static Level calculateEngReactorCorePt1(Level level) {
Level calculatedLevel = new Level();

calculatedLevel.name = level.name;
calculatedLevel.x = level.x;
calculatedLevel.y = level.y + 1.9183100f;
calculatedLevel.z = level.z;

return calculatedLevel;
}

private static Level calculateSciHospitalUpper(Level level) {
Level calculatedLevel = new Level();

calculatedLevel.name = level.name;
calculatedLevel.x = level.z + 107;
calculatedLevel.x = level.z + -107.1510000f;
calculatedLevel.y = level.y + 0.0000041f;
calculatedLevel.z = (-1 * level.x) + 15.9814000f;

return calculatedLevel;
}

private static Level calculateHabAirportM1(Level level) {
Level calculatedLevel = new Level();

calculatedLevel.name = level.name;
calculatedLevel.x = level.x + 22.5322000f;
calculatedLevel.y = level.y + 17.8760000f;
calculatedLevel.z = level.z + -61.5897000f;

return calculatedLevel;
}

private static Level calculateHabCorporatepent(Level level) {
Level calculatedLevel = new Level();

calculatedLevel.name = level.name;
calculatedLevel.x = level.x - 0.0000529f;
calculatedLevel.y = level.y;
calculatedLevel.z = (-1 * level.x) + 16;
calculatedLevel.z = level.z;

return calculatedLevel;
}
Expand Down
Binary file modified AIUtils/bin/Debug/AIUtils.exe
Binary file not shown.
Binary file modified AIUtils/bin/Debug/AIUtils.pdb
Binary file not shown.
Binary file modified AIUtils/bin/Release/AIUtils.exe
Binary file not shown.
Binary file modified AIUtils/bin/Release/AIUtils.pdb
Binary file not shown.
Binary file modified AIUtils/obj/Debug/AIUtils.exe
Binary file not shown.
Binary file modified AIUtils/obj/Debug/AIUtils.pdb
Binary file not shown.
Binary file modified AIUtils/obj/Release/AIUtils.exe
Binary file not shown.
Binary file modified AIUtils/obj/Release/AIUtils.pdb
Binary file not shown.

0 comments on commit f1fd920

Please sign in to comment.