clean
This commit is contained in:
parent
164cf5886d
commit
aa56a22f1b
21
Carrier.rs
21
Carrier.rs
|
@ -1,21 +0,0 @@
|
||||||
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,
|
|
||||||
location: &Star
|
|
||||||
action_queue: VecDeque<(&Star, Action)>,
|
|
||||||
past_actions: VecDeque<(&Star, Action)>,
|
|
||||||
owner: &player
|
|
||||||
}
|
|
13
Stars.rs
13
Stars.rs
|
@ -1,13 +0,0 @@
|
||||||
struct Star {
|
|
||||||
resources: u16,
|
|
||||||
name: String,
|
|
||||||
ships: u16,
|
|
||||||
owner: &Player,
|
|
||||||
infrastructure: Infrastructure
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Infrastructure {
|
|
||||||
Fabrication: u8,
|
|
||||||
Science: u8,
|
|
||||||
Finance: u8
|
|
||||||
}
|
|
|
@ -1,11 +1,20 @@
|
||||||
enum Order {
|
enum Order {
|
||||||
NOTHING
|
NOTHING,
|
||||||
|
GARRISON(u16),
|
||||||
|
DROP_ALL,
|
||||||
|
DROP(u16),
|
||||||
|
DROP_ALL_BUT(u16),
|
||||||
|
COLLECT_ALL,
|
||||||
|
COLLECT(u16),
|
||||||
|
COLLECT_ALL_BUT(u16),
|
||||||
|
LOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Carrier {
|
pub struct Carrier {
|
||||||
OwnerID: u8,
|
owner: &Player,
|
||||||
name: String,
|
name: String,
|
||||||
ships: u16,
|
ships: u16,
|
||||||
location: (u16, u16),
|
location: (u16, u16),
|
||||||
orders: Vec<Order>
|
orders: Vec<(&Star, Order)>,
|
||||||
|
order_pointer: u8
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@ struct Infrastructre {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Star {
|
pub struct Star {
|
||||||
ownerID: Option<u8>,
|
owner: Option<&player>,
|
||||||
location: (u16, u16),
|
location: (u16, u16),
|
||||||
name: String,
|
name: String,
|
||||||
natural_resources: u16,
|
natural_resources: u16,
|
||||||
|
|
Loading…
Reference in New Issue