Skip to content

Instantly share code, notes, and snippets.

@cgdangelo
Created May 7, 2018 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgdangelo/a7a4cb5a1a936997920d45c9774e3761 to your computer and use it in GitHub Desktop.
Save cgdangelo/a7a4cb5a1a936997920d45c9774e3761 to your computer and use it in GitHub Desktop.
mod simfantasy {
use std::time::Duration;
use std::time::Instant;
pub struct Simulation {
pub combat_length: Duration,
start_time: Option<Instant>,
current_time: Option<Instant>,
}
impl Simulation {
pub fn new(seconds: u64) -> Simulation {
Simulation {
combat_length: Duration::from_secs(seconds),
start_time: None::<Instant>,
current_time: None::<Instant>,
}
}
pub fn run(&self) {
let now = Instant::now();
self.start_time = Some(now);
self.current_time = Some(now);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment