use rust_sc2::prelude::*;
#[bot]
#[derive(Default)]
struct EmptyBot;
impl Player for EmptyBot {
fn get_player_settings(&self) -> PlayerSettings {
PlayerSettings::new(Race::Random)
}
fn on_event(&mut self, event: Event) -> SC2Result<()> {
match event {
Event::UnitDestroyed(tag, alliance) => {
match alliance {
Some(Alliance::Own) => { }
Some(Alliance::Neutral) => { }
_ => { }
}
}
Event::UnitCreated(tag) => {
if let Some(u) = self.units.my.units.get(tag) { }
}
Event::ConstructionStarted(tag) => {
if let Some(u) = self.units.my.structures.get(tag) { }
}
Event::ConstructionComplete(tag) => {
if let Some(u) = self.units.my.structures.get(tag) { }
}
Event::RandomRaceDetected(race) => { }
}
Ok(())
}
}
fn main() -> SC2Result<()> {
let mut bot = EmptyBot::default();
run_vs_computer(
&mut bot,
Computer::new(Race::Random, Difficulty::VeryEasy, None),
"EverDreamLE",
Default::default(),
)
}