Class: Core::Models::Campaigns::Map

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/core/models/campaigns/map.rb

Overview

A map is a battleground where the players can place tokens and live the adventure.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#campaignCore::Models::Campaign

Returns the campaign in which the map can be found.

Returns:



23
# File 'lib/core/models/campaigns/map.rb', line 23

belongs_to :campaign, class_name: 'Core::Models::Campaign', inverse_of: :maps

#heightInteger

Returns the number of lines in the map matric.

Returns:

  • (Integer)

    the number of lines in the map matric.



16
# File 'lib/core/models/campaigns/map.rb', line 16

field :height, type: Integer, default: 1

#positionsArray<Core::Model::Campaigns::TokenPosition>

Returns the instanciated tokens on this map.

Returns:

  • (Array<Core::Model::Campaigns::TokenPosition>)

    the instanciated tokens on this map.



27
# File 'lib/core/models/campaigns/map.rb', line 27

embeds_many :positions, class_name: 'Core::Models::Campaigns::TokenPosition', inverse_of: :map

#widthInteger

Returns the number of columns in the map matric.

Returns:

  • (Integer)

    the number of columns in the map matric.



19
# File 'lib/core/models/campaigns/map.rb', line 19

field :width, type: Integer, default: 1