Class: TyranoDsl::Elements::Character
- Inherits:
-
Object
- Object
- TyranoDsl::Elements::Character
- Defined in:
- lib/tyrano_dsl/elements/character.rb
Overview
A declared character
Constant Summary collapse
- CHARACTER_DIRECTORY =
File.join('data', 'fgimage', 'chara')
Instance Attribute Summary collapse
- #default_stance ⇒ TyranoDsl::Elements::Stance readonly
- #index ⇒ Index readonly
- #name ⇒ String readonly
- #stances ⇒ Hash{String => TyranoDsl::Elements::Stance} readonly
Instance Method Summary collapse
-
#initialize(name, declared_stances, index) ⇒ Character
constructor
A new instance of Character.
Constructor Details
#initialize(name, declared_stances, index) ⇒ Character
Returns a new instance of Character.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/tyrano_dsl/elements/character.rb', line 22 def initialize(name, declared_stances, index) @name = name @stances = stances @index = index @stances = {} @stances_target_long_files_names = {} @stance_target_short_file_names = {} declared_stances.each_pair do |stance_name, stance_file| short_file_name = File.join(index.to_s, "#{@stances.length}#{File.extname(stance_file)}") long_file_name = File.join( CHARACTER_DIRECTORY, short_file_name) stance = TyranoDsl::Elements::Stance.new( stance_name, stance_file, short_file_name, long_file_name) @stances[stance_name] = stance if stance_name == :default @default_stance = stance @default_stance_target_short_file_name = short_file_name end end end |
Instance Attribute Details
#default_stance ⇒ TyranoDsl::Elements::Stance (readonly)
17 18 19 |
# File 'lib/tyrano_dsl/elements/character.rb', line 17 def default_stance @default_stance end |
#index ⇒ Index (readonly)
13 14 15 |
# File 'lib/tyrano_dsl/elements/character.rb', line 13 def index @index end |
#name ⇒ String (readonly)
11 12 13 |
# File 'lib/tyrano_dsl/elements/character.rb', line 11 def name @name end |
#stances ⇒ Hash{String => TyranoDsl::Elements::Stance} (readonly)
15 16 17 |
# File 'lib/tyrano_dsl/elements/character.rb', line 15 def stances @stances end |