1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-09-28 13:09:07 +00:00
doukutsu-rs/src/entity.rs

14 lines
488 B
Rust
Raw Normal View History

2020-08-18 16:46:07 +00:00
use ggez::{Context, GameResult};
2020-08-19 11:21:40 +00:00
use crate::engine_constants::EngineConstants;
use crate::game_state::GameState;
use crate::GameContext;
2020-08-18 16:46:07 +00:00
pub trait GameEntity {
2020-08-19 11:21:40 +00:00
fn init(&mut self, _state: &GameState, _game_ctx: &mut GameContext, _ctx: &mut Context) -> GameResult { Ok(()) }
2020-08-18 16:46:07 +00:00
2020-08-19 11:21:40 +00:00
fn tick(&mut self, state: &GameState, constants: &EngineConstants, ctx: &mut Context) -> GameResult;
fn draw(&self, state: &GameState, game_ctx: &mut GameContext, ctx: &mut Context) -> GameResult;
2020-08-18 16:46:07 +00:00
}