Add the AirDef tablet web panel and battle archive (#153)

This commit is contained in:
2026-12-02 00:46:18 +03:00
parent dfb306edd7
commit 906159b17f
22 changed files with 2770 additions and 1 deletions
+3
View File
@@ -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);