diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2017-05-20 18:01:43 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2017-05-20 18:01:43 +0200 |
commit | 7dd0fe43fe7e72e5f56a8a61bbaec3a78399e6c8 (patch) | |
tree | 4b1cfd0375609019c0e1a07f34bf8e5574ffce84 /src/ships.rs | |
parent | 10c8ceb168e86a58e38086691ddd519bac63ff03 (diff) |
Moved ship placement knowledge out to be one per ship
Diffstat (limited to 'src/ships.rs')
-rw-r--r-- | src/ships.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ships.rs b/src/ships.rs index 344f9ed..ef29fe9 100644 --- a/src/ships.rs +++ b/src/ships.rs @@ -54,4 +54,16 @@ impl Ship { &Submarine => 3 } } + + pub fn all_types() -> Vec<Ship> { + use Ship::*; + + vec!( + Battleship, + Carrier, + Cruiser, + Destroyer, + Submarine + ) + } } |