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
|
|
|
}
|