-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
126 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using NovemberPirates.Components; | ||
|
||
namespace NovemberPirates.Utilities.Data | ||
{ | ||
internal static class ShipData | ||
{ | ||
internal static bool CanDo(this Ship ship, ShipAbilities ability) | ||
{ | ||
return ship.Crew >= Data[$"{ship.BoatType}{ability}"]; | ||
} | ||
|
||
static readonly Dictionary<string, int> Data = new() | ||
{ | ||
// Small Ships | ||
{ $"{BoatType.HullSmall}{ShipAbilities.Steering}", 1 }, | ||
{ $"{BoatType.HullSmall}{ShipAbilities.Rowing}", 2 }, | ||
{ $"{BoatType.HullSmall}{ShipAbilities.HalfSail}", 3 }, | ||
{ $"{BoatType.HullSmall}{ShipAbilities.FullSail}", 10 }, | ||
{ $"{BoatType.HullSmall}{ShipAbilities.OneCannon}", 5 }, | ||
{ $"{BoatType.HullSmall}{ShipAbilities.TwoCannon}", 7 }, | ||
|
||
// Medium Ships | ||
{ $"{BoatType.HullMedium}{ShipAbilities.Steering}", 1 }, | ||
{ $"{BoatType.HullMedium}{ShipAbilities.Rowing}", 2 }, | ||
{ $"{BoatType.HullMedium}{ShipAbilities.HalfSail}", 3 }, | ||
{ $"{BoatType.HullMedium}{ShipAbilities.FullSail}", 10 }, | ||
{ $"{BoatType.HullMedium}{ShipAbilities.OneCannon}", 5 }, | ||
{ $"{BoatType.HullMedium}{ShipAbilities.TwoCannon}", 7 }, | ||
|
||
// Large Ships | ||
{ $"{BoatType.HullLarge}{ShipAbilities.Steering}", 1 }, | ||
{ $"{BoatType.HullLarge}{ShipAbilities.Rowing}", 2 }, | ||
{ $"{BoatType.HullLarge}{ShipAbilities.HalfSail}", 3 }, | ||
{ $"{BoatType.HullLarge}{ShipAbilities.FullSail}", 10 }, | ||
{ $"{BoatType.HullLarge}{ShipAbilities.OneCannon}", 5 }, | ||
{ $"{BoatType.HullLarge}{ShipAbilities.TwoCannon}", 7 }, | ||
}; | ||
} | ||
internal enum ShipAbilities | ||
{ | ||
Steering, | ||
Rowing, | ||
HalfSail, | ||
FullSail, | ||
|
||
OneCannon, | ||
TwoCannon, | ||
ThreeCannon, | ||
FourCannon, | ||
FiveCannon, | ||
SixCannon, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters