Core: SOme code cleanup, more to follow.

This commit is contained in:
hondacrx
2021-03-20 22:48:48 -04:00
parent 62f554f2e0
commit 62ec699ec6
318 changed files with 5080 additions and 5125 deletions
+9 -14
View File
@@ -99,14 +99,12 @@ namespace Game.AI
public static IMovementGenerator SelectMovementAI(Creature creature)
{
switch (creature.DefaultMovementType)
return creature.DefaultMovementType switch
{
case MovementGeneratorType.Random:
return new RandomMovementGenerator();
case MovementGeneratorType.Waypoint:
return new WaypointMovementGenerator();
}
return null;
MovementGeneratorType.Random => new RandomMovementGenerator(),
MovementGeneratorType.Waypoint => new WaypointMovementGenerator(),
_ => null,
};
}
public static GameObjectAI SelectGameObjectAI(GameObject go)
@@ -116,14 +114,11 @@ namespace Game.AI
if (scriptedAI != null)
return scriptedAI;
switch (go.GetAIName())
return go.GetAIName() switch
{
case "GameObjectAI":
default:
return new GameObjectAI(go);
case "SmartGameObjectAI":
return new SmartGameObjectAI(go);
}
"SmartGameObjectAI" => new SmartGameObjectAI(go),
_ => new GameObjectAI(go),
};
}
}
}