aboutsummaryrefslogtreecommitdiff
path: root/karld/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-06-11 18:55:54 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-06-11 18:55:54 +0200
commit163052cd25d927c9437a2234befd22c9d143c4d4 (patch)
tree5181ce8ee7755024cba77d3172c637ff0e7c59df /karld/src/main.rs
parentea37afe9ae9a1607fa3b6f365b9307c579c45b8d (diff)
downloadkarlender-163052cd25d927c9437a2234befd22c9d143c4d4.tar
karlender-163052cd25d927c9437a2234befd22c9d143c4d4.tar.bz2
karlender-163052cd25d927c9437a2234befd22c9d143c4d4.tar.zst
redundant Instance
Diffstat (limited to 'karld/src/main.rs')
-rw-r--r--karld/src/main.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/karld/src/main.rs b/karld/src/main.rs
index 181c2be..35cca04 100644
--- a/karld/src/main.rs
+++ b/karld/src/main.rs
@@ -10,7 +10,7 @@ use crossbeam_channel::Sender;
use helper::Overlaps;
use interface::network_loop;
use karlcommon::{
- ClientboundPacket, Condition, Instance, Property, ProtoError, Schedule, ServerboundPacket, Task,
+ ClientboundPacket, Condition, Property, ProtoError, Schedule, ServerboundPacket, Task,
};
use log::{debug, error, info};
use std::{collections::HashMap, sync::RwLock};
@@ -118,10 +118,7 @@ pub fn handle_packet(client: u32, packet: ServerboundPacket, responder: Sender<C
Schedule::Dynamic { .. } => (), // TODO
Schedule::Static(r) => {
if range.overlaps(r.clone()) {
- ocs.push(Instance {
- of: t.id,
- at: Some(r.start)..Some(r.end),
- })
+ ocs.push(Some(r.start)..Some(r.end))
}
}
Schedule::Condition(o) => {
@@ -131,10 +128,7 @@ pub fn handle_packet(client: u32, packet: ServerboundPacket, responder: Sender<C
let start =
o.find(condition::Edge::Start, condition::Direction::Forward, time);
let end = o.find(condition::Edge::End, condition::Direction::Forward, time);
- ocs.push(Instance {
- of: t.id,
- at: start.map(|e| e.timestamp())..end.map(|e| e.timestamp()),
- });
+ ocs.push(start.map(|e| e.timestamp())..end.map(|e| e.timestamp()));
if let Some(s) = end {
if let Some(e) = end_time {
if s > e {