Add some types

This commit is contained in:
Daniel Løvbrøtte Olsen 2019-01-23 21:04:52 +01:00
parent c022cf1551
commit d7baa63e64
3 changed files with 58 additions and 0 deletions

20
Carrier.rs Normal file
View File

@ -0,0 +1,20 @@
use std::collections::VecDeque;
enum Action {
NOTHING,
GARRISON(u16),
DROP_ALL,
DROP(u16),
DROP_ALL_BUT(u16),
COLLECT_ALL,
COLLECT(u16),
COLLECT_ALL_BUT(u16),
LOOP
}
struct Carrier {
ships: u16,
action_queue: VecDeque<(&star, Action)>,
past_actions: VecDeque<(&star, Action)>,
owner: &player
}

25
Player.rs Normal file
View File

@ -0,0 +1,25 @@
enum Race {
Griffin,
}
struct Research {
Weapons: u8,
Banking: u8,
Manufactoring: u8,
Terraforming: u8,
Hyperspace: u8,
Experimentation: u8,
Scanning: u8
}
impl Research {
fn getWeaponsLevel() {
this.Weapons.
}
}
struct Player {
Name: String,
Color: (u8, u8, u8),
Race: Race,
}

13
Stars.rs Normal file
View File

@ -0,0 +1,13 @@
struct Star {
resources: u16,
name: String,
ships: u16,
owner: &Player,
infrastructure: Infrastructure
}
struct Infrastructure {
Fabrication: u8,
Science: u8,
Finance: u8
}