Created
May 7, 2018 18:48
-
-
Save cgdangelo/a7a4cb5a1a936997920d45c9774e3761 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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