Reduced backend resposibility to emmit game events, whole addon logic implemented in python side

This commit is contained in:
Wiktor Mazur
2020-02-18 16:55:33 +01:00
parent d73f34a33b
commit 133975cd77
78 changed files with 3203 additions and 1331 deletions
+43
View File
@@ -0,0 +1,43 @@
#![allow(dead_code)]
use crate::photon_messages;
use super::player::StaticId;
#[derive(Debug, Clone, PartialEq)]
pub struct Player {
pub id: StaticId,
pub name: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Damage {
pub source: StaticId,
pub target: Option<StaticId>,
pub value: f32,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Fame {
pub source: StaticId,
pub value: f32,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Items {
pub source: StaticId,
pub value: photon_messages::Items,
}
#[derive(Debug, Clone, PartialEq)]
pub enum Event {
MainPlayerAppeared(Player),
PlayerAppeared(Player),
DamageDone(Damage),
HealthReceived(Damage),
ZoneChange,
EnterCombat(Player),
LeaveCombat(Player),
UpdateFame(Fame),
UpdateItems(Items),
}