diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 17:21:45 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 17:21:45 +0100 |
| commit | 0bba89a7858ce091f485e04284f853e1f7f304af (patch) | |
| tree | 89ba42616e0f245cc84c96cc5b353eea117057d0 /code/team/Team.cs | |
| parent | 87d74b50bf443bf199be05bd03afdca6ece082ff (diff) | |
Diffstat (limited to 'code/team/Team.cs')
| -rw-r--r-- | code/team/Team.cs | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/code/team/Team.cs b/code/team/Team.cs index ef065a4..05723c2 100644 --- a/code/team/Team.cs +++ b/code/team/Team.cs @@ -1,10 +1,4 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MurderGame;
+namespace MurderGame;
public enum Team : ushort
{
@@ -17,25 +11,27 @@ public enum Team : ushort // why are c# enums so bad
public static class TeamCapabilities
{
- public static bool CanSprint(Team team)
+ public static bool CanSprint( Team team )
{
return team switch
{
Team.Murderer => true,
- _ => false,
+ _ => false
};
}
-
- public static void GiveLoadouts(Player pawn)
+
+ public static void GiveLoadouts( Player pawn )
{
pawn.Inventory.Clear();
-
- switch (pawn.Team)
+
+ switch ( pawn.Team )
{
case Team.Detective:
- GiveDetectiveWeapon(pawn); break;
+ GiveDetectiveWeapon( pawn );
+ break;
case Team.Murderer:
- GiveMurdererWeapon(pawn); break;
+ GiveMurdererWeapon( pawn );
+ break;
case Team.Spectator:
case Team.Bystander:
default: break;
@@ -44,23 +40,20 @@ public static class TeamCapabilities private static void GiveDetectiveWeapon( Player pawn )
{
- Pistol pistol = new()
- {
- Ammo = 1
- };
+ Pistol pistol = new() { Ammo = 1 };
pawn.Inventory.SetPrimaryWeapon( pistol );
}
- private static void GiveMurdererWeapon(Player pawn)
+ private static void GiveMurdererWeapon( Player pawn )
{
pawn.Inventory.SetPrimaryWeapon( new Knife() );
pawn.Components.Create<FootprintTrackerComponent>();
}
}
+
public static class TeamOperations
{
-
- public static string GetTeamName(Team team)
+ public static string GetTeamName( Team team )
{
return team switch
{
@@ -68,29 +61,31 @@ public static class TeamOperations Team.Murderer => "Murderer",
Team.Bystander => "Bystander",
Team.Spectator => "Spectator",
- _ => "None",
+ _ => "None"
};
}
- public static string GetTeamColour(Team team)
+ public static string GetTeamColour( Team team )
{
return team switch
{
Team.Detective => "#33A0FF",
Team.Murderer => "#FF4136",
Team.Bystander => "#33A0FF",
- _ => "#AAAAAA",
+ _ => "#AAAAAA"
};
}
- public static string GetTeamDescription(Team team)
+ public static string GetTeamDescription( Team team )
{
return team switch
{
- Team.Detective => "There is a murderer on the loose! Find out who they are and shoot them before they kill everybody else.",
+ Team.Detective =>
+ "There is a murderer on the loose! Find out who they are and shoot them before they kill everybody else.",
Team.Murderer => "Kill everybody else in time and avoid detection. At least one other player is armed.",
- Team.Bystander => "There is a murderer on the loose! Avoid getting killed and work with others to establish who the murderer is.",
- _ => "None",
+ Team.Bystander =>
+ "There is a murderer on the loose! Avoid getting killed and work with others to establish who the murderer is.",
+ _ => "None"
};
}
}
|
