Add the AirDef tablet web panel and battle archive (#153)
This commit is contained in:
@@ -99,11 +99,13 @@ pub struct Entry {
|
||||
#[derive(Default)]
|
||||
pub struct History {
|
||||
entries: VecDeque<Entry>,
|
||||
first: u64,
|
||||
last: HashMap<(u32, Channel), (Option<u32>, Outcome)>,
|
||||
truncated: bool,
|
||||
}
|
||||
|
||||
impl History {
|
||||
pub fn first_index(&self) -> u64 { self.first }
|
||||
pub fn entries(&self) -> impl DoubleEndedIterator<Item = &Entry> {
|
||||
self.entries.iter()
|
||||
}
|
||||
@@ -184,6 +186,7 @@ impl History {
|
||||
fn push(&mut self, entry: Entry) {
|
||||
if self.entries.len() == MAX_ENTRIES {
|
||||
self.entries.pop_front();
|
||||
self.first += 1;
|
||||
self.truncated = true;
|
||||
}
|
||||
self.entries.push_back(entry);
|
||||
|
||||
Reference in New Issue
Block a user