BattleCity.Environment behaviour (battle_city v0.1.2) View Source

Environment

Link to this section Summary

Link to this section Types

Specs

Specs

t() :: %BattleCity.Environment{
  __module__: module(),
  enter?: boolean(),
  health: health(),
  id: BattleCity.id(),
  position: BattleCity.Position.t(),
  raw: binary(),
  shape: shape()
}

Link to this section Functions

Specs

copy_rxy(t(), object()) :: object()

Specs

copy_xy(t(), object()) :: object()
Link to this function

enter(environment, bullet)

View Source

Specs

enter(t(), object()) :: enter_result()

Specs

hit(t(), integer()) :: t()

Specs

leave(t(), object()) :: enter_result()

Specs

reset(t(), module()) :: t()

Link to this section Callbacks

Specs

handle_enter(t(), object()) :: enter_result()
Link to this callback

handle_init(map)

View Source (optional)

Specs

handle_init(map()) :: map() | {:error, :atom}

Specs

handle_leave(t(), object()) :: enter_result()