Skip to content

Commit

Permalink
0.9.0 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akanalytics committed Jun 6, 2024
1 parent e54788d commit 9ea1e4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions crates/odonata-base/src/eg/endgame.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use serde::{Deserialize, Serialize};
use strum::IntoEnumIterator;
use strum_macros::{Display, EnumCount, EnumIter, IntoStaticStr};
use strum_macros::{Display, EnumCount, IntoStaticStr};

use crate::prelude::*;
use crate::trace::stat::{SliceStat, Stat};
Expand Down Expand Up @@ -55,7 +54,7 @@ impl Configurable for EndGameScoring {
}
}

#[derive(Copy, Default, Clone, PartialEq, Debug, IntoStaticStr, EnumCount, EnumIter, Display)]
#[derive(Copy, Default, Clone, PartialEq, Debug, IntoStaticStr, EnumCount, Display)]
pub enum EndGame {
#[default]
Unknown, // for when its too costly to work out who wins
Expand Down Expand Up @@ -139,11 +138,11 @@ pub enum EndGame {
use static_init::dynamic;
#[dynamic]
static ENDGAME_COUNTS: Vec<Stat> = {
let mut vec = vec![];
for eg in EndGame::iter() {
let s: &'static str = eg.into();
vec.push(Stat::new(s));
}
let vec = vec![];
// for eg in EndGame::iter() {
// let s: &'static str = eg.into();
// vec.push(Stat::new(s));
// }
vec
};

Expand Down Expand Up @@ -417,7 +416,7 @@ impl EndGame {

pub fn from_board(b: &Board) -> Self {
let eg = Self::private_ctor(b);
ENDGAME_COUNTS[eg as usize].increment();
// ENDGAME_COUNTS[eg as usize].increment();
eg
}

Expand Down
6 changes: 3 additions & 3 deletions crates/odonata-base/src/infra/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,9 +1015,9 @@ impl fmt::Display for Metrics {
//
let mut b = Builder::default();
b.set_header(["Counter", "Value"]);
for eg in EndGame::iter() {
b.push_record([&eg.to_string(), &i(self.endgame[eg as usize])]);
}
// for eg in EndGame::iter() {
// b.push_record([&eg.to_string(), &i(self.endgame[eg as usize])]);
// }
let mut t = b.build();
t.with(style.clone())
.with(Modify::new(Rows::single(0)).with(Border::default().top('-')))
Expand Down

0 comments on commit 9ea1e4a

Please sign in to comment.