BattleCity.Context (battle_city v0.1.8) View Source
Context
Link to this section Summary
Link to this section Types
Specs
Specs
object_struct() :: BattleCity.PowerUp.t() | BattleCity.Tank.t() | BattleCity.Bullet.t() | nil
Specs
t() :: %BattleCity.Context{ __counters__: map(), __events__: [BattleCity.Event.t()], __global_callbacks__: [callback_fn()], __opts__: map(), bot_loop_interval: integer(), bullets: %{required(BattleCity.id()) => BattleCity.Bullet.t()}, enable_bot: boolean(), level: BattleCity.level(), loop_interval: integer(), mock: boolean(), objects: %{ required(BattleCity.Position.coordinate()) => %{ required(Object.t()) => Object.value() } }, power_ups: %{required(BattleCity.id()) => BattleCity.PowerUp.t()}, rest_enemies: integer(), rest_players: integer(), score: integer(), shovel?: boolean(), slug: term(), stage: BattleCity.Stage.t(), state: state(), tanks: %{required(BattleCity.id()) => BattleCity.Tank.t()}, timeout_interval: integer() }
Specs
update_raw_fun() :: (object_struct() -> {object_struct(), object_struct()})
Link to this section Functions
Specs
all_path_object(t(), BattleCity.Position.t()) :: [ {Object.kv(), BattleCity.Position.direction()} ]
Specs
Specs
bullet_grids(t()) :: [grid()]
Specs
Specs
camp_direction?({Object.kv(), BattleCity.Position.direction()}, boolean()) :: boolean()
Specs
delete_object(t(), BattleCity.object_keys(), BattleCity.id()) :: t()
Specs
grid(grid_struct()) :: grid()
Specs
grids(t()) :: [grid()]
Specs
handle_actions(t(), object_struct(), [BattleCity.ContextCallback.t()]) :: t()
Specs
Specs
handle_object(t(), object_struct()) :: t()
Specs
Specs
map_grids(t()) :: [grid()]
Specs
maybe_add_points(t(), BattleCity.Tank.t()) :: t()
Specs
maybe_add_power_up(t(), BattleCity.Tank.t()) :: t()
Specs
object_grids(t(), nil | [BattleCity.short_type()]) :: [grid()]
Specs
path_object(t(), BattleCity.Position.t(), BattleCity.Position.direction() | nil) :: [Object.kv()]
Specs
power_up_grids(t()) :: [grid()]
Specs
put_changed_object(t(), object_struct()) :: t()
Specs
put_object({t(), object_struct()}) :: t()
Specs
put_object(t(), object_struct() | [object_struct()]) :: t()
Specs
tank_grids(t()) :: [grid()]
Specs
update_object_and_ctx!( t(), BattleCity.object_keys(), BattleCity.id(), (... -> {term(), t(), object_struct()}), [term()] ) :: {term(), t(), object_struct()}
Specs
update_object_raw( t(), BattleCity.object_keys(), BattleCity.id(), update_raw_fun() ) :: t()
Specs
update_object_raw!( t(), BattleCity.object_keys(), BattleCity.id(), update_raw_fun() ) :: t()