class GeoWars::Map

Defined in:

geo_wars/map.cr

Constant Summary

DEFAULT_CELL_SIZE = 64
POSSIBLE_MOVES = (-1..1).flat_map do |x| (-1..1).map do |y| {x: x, y: y} end end.select do |move| !((move[:x] == 0) && (move[:y] == 0)) end

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(cells_x : Int32, cells_y : Int32, players : Array(GeoWars::Player), width = Game::SCREEN_WIDTH, height = Game::SCREEN_HEIGHT, cell_size = DEFAULT_CELL_SIZE, map_file = "map") #

[View source]

Class Method Detail

def self.serialize_class_info(obj) #

[View source]

Instance Method Detail

def cursor_cell #

[View source]
def draw #

[View source]
def editing? : Bool? #

[View source]
def editor_update(frame_time) #

[View source]
def flip_terrain #

[View source]
def load(map_file = "map") #

[View source]
def new_player_turn #

[View source]
def save(map_file = "map") #

[View source]
def selected_unit : Units::Unit | Nil #

[View source]
def selected_unit=(selected_unit : Units::Unit | Nil) #

[View source]
def set_terrain(terrain) #

[View source]
def turn_player : Player #

[View source]
def turn_player=(turn_player : Player) #

[View source]
def update(frame_time) #

[View source]
def update_cells #

[View source]