Static World Gen and Display for the Overworld (#5)
All checks were successful
Rust / rustfmt (push) Successful in 25s
Rust / clippy (push) Successful in 1m23s
Rust / build (push) Successful in 3m11s

Co-authored-by: luckyturtledev <git@lukas1818.de>
Reviewed-on: #5
Co-authored-by: Dominic <git@msrd0.de>
Co-committed-by: Dominic <git@msrd0.de>
This commit is contained in:
Dominic 2024-07-06 20:23:25 +00:00 committed by msrd0
parent 5a4451d6a7
commit 8143a99843
13 changed files with 928 additions and 21 deletions

View file

@ -1,18 +1,40 @@
use comfy::*;
use crate::{
activities::{house, overworld, Activity},
State
};
use comfy::EngineContext;
use std::ops::Sub;
pub fn update(state: &mut State, engine: &mut EngineContext) {
#[repr(i32)]
pub enum ZLayer {
MapMax = -1,
Human = 0,
Ghost = 1
}
impl From<ZLayer> for i32 {
fn from(value: ZLayer) -> Self {
// safe because #[repr(i32)]
value as i32
}
}
impl Sub<i32> for ZLayer {
type Output = i32;
fn sub(self, other: i32) -> Self::Output {
i32::from(self) - other
}
}
pub fn update(state: &mut State, engine: &mut EngineContext<'_>) {
match state.activity {
Activity::House => house::update(state, engine),
Activity::Overworld => overworld::update(state, engine)
}
}
pub fn draw(state: &State, engine: &EngineContext) {
pub fn draw(state: &State, engine: &EngineContext<'_>) {
match state.activity {
Activity::House => house::draw(state, engine),
Activity::Overworld => overworld::draw(state, engine)