class MahjonggModel

Defined in:

mahjongg_model.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(layout, game_number : Int = 10) #

[View source]

Instance Method Detail

def any_visible?(positions : Array(Int32)) #

[View source]
def blocked_on_top?(position_id : Int32) #

[View source]
def create_position_to_tile #

[View source]
def create_tiles #

[View source]
def find_matches #

[View source]
def free : Array(Tile) #

[View source]
def game_number : Int32 #

[View source]
def get_tile(position_id) #

returns the actual tile object


[View source]
def is_free?(position) #

[View source]
def matches : Array(Array(Int32)) #

[View source]
def position_to_tile_map : StaticArray(Int32, 144) #

find the tile_id for a given position_id


[View source]
def possible_matches : Array(Array(MahjonggModel::Tile)) #

[View source]
def process_selection(position_id : Int32) #

[View source]
def shuffle_position(seed : Int) #

positions are randomly shuffled by a seed. Index of this array is the tile number


[View source]
def side_blocked?(position_id : Int32) #

[View source]
def tile_to_position_map : Array(Int32) #

find the position_id for a given tile_id


[View source]
def tiles : Array(Tile) #

[View source]
def undo #

[View source]