class Risk::Manager

Defined in:

risk/manager.cr

Constant Summary

AttackPhases = [:select, :choose_dice, :attack, :move]
HeldTerritoriesRatio = 3
MinDraftUnits = 3
Phases = [:order, :allocate_territories, :allocate_armies, :turns]
TurnPhases = [:predraft, :draft, :attack, :fortify]

Constructors

Instance Method Summary

Constructor Detail

def self.new(players : Array(Risk::Player), map : Risk::Map, auto_allocate_territories : Bool = true, auto_allocate_armies : Bool = true) #

[View source]

Instance Method Detail

def allocate_armies(mouse, mouse_coords) #

[View source]
def allocate_army(territory) #

[View source]
def allocate_territories(mouse, mouse_coords) #

[View source]
def allocate_territory(territory) #

[View source]
def attack_attack(keys) #

[View source]
def attack_back_to_select #

[View source]
def attack_choose_dice(keys) #

[View source]
def attack_move(keys, mouse, mouse_coords) #

[View source]
def attack_phase : Symbol #

[View source]
def attack_phase_index : UInt8 #

[View source]
def attack_select(keys, mouse, mouse_coords) #

[View source]
def attacked? : Bool #

[View source]
def attacker_dice : UInt8 #

[View source]
def attacker_losses : UInt8 #

[View source]
def attacker_max_dice : UInt8 #

[View source]
def attacker_values : Array(UInt8) #

[View source]
def auto_allocate_armies? : Bool #

[View source]
def auto_allocate_army(territory) #

[View source]
def auto_allocate_territories? : Bool #

[View source]
def auto_allocate_territory(territory) #

[View source]
def checks_mouse_hover(territories, mouse_coords) #

[View source]
def clear_mouse_hover #

[View source]
def defender_dice : UInt8 #

[View source]
def defender_losses : UInt8 #

[View source]
def defender_values : Array(UInt8) #

[View source]
def determine_order #

[View source]
def draft(mouse, mouse_coords) #

[View source]
def exit? : Bool #

[View source]
def fortify(keys, mouse, mouse_coords) #

[View source]
def map : Map #

[View source]
def next_attack_phase #

[View source]
def next_phase #

[View source]
def next_turn #

[View source]
def next_turn_phase #

[View source]
def phase : Symbol #

[View source]
def phase_index : UInt8 #

[View source]
def player : Player #

[View source]
def players : Array(Player) #

[View source]
def predraft #

[View source]
def random_dice_roll #

[View source]
def set_dice #

[View source]
def turn_index : UInt8 #

[View source]
def turn_phase : Symbol #

[View source]
def turn_phase_index : UInt8 #

[View source]
def update(frame_time, keys, mouse, mouse_coords) #

[View source]