Class: RoadToRubykaigi::Graphics::Player::Variant

Inherits:
Data
  • Object
show all
Defined in:
lib/road_to_rubykaigi/graphics/player.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#attack_framesObject (readonly)

Returns the value of attribute attack_frames

Returns:

  • (Object)

    the current value of attack_frames



20
21
22
# File 'lib/road_to_rubykaigi/graphics/player.rb', line 20

def attack_frames
  @attack_frames
end

#default_framesObject (readonly)

Returns the value of attribute default_frames

Returns:

  • (Object)

    the current value of default_frames



20
21
22
# File 'lib/road_to_rubykaigi/graphics/player.rb', line 20

def default_frames
  @default_frames
end

#directionObject (readonly)

Returns the value of attribute direction

Returns:

  • (Object)

    the current value of direction



20
21
22
# File 'lib/road_to_rubykaigi/graphics/player.rb', line 20

def direction
  @direction
end

#postureObject (readonly)

Returns the value of attribute posture

Returns:

  • (Object)

    the current value of posture



20
21
22
# File 'lib/road_to_rubykaigi/graphics/player.rb', line 20

def posture
  @posture
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



20
21
22
# File 'lib/road_to_rubykaigi/graphics/player.rb', line 20

def status
  @status
end

Class Method Details

.build(posture:, status:, direction:, parts:) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/road_to_rubykaigi/graphics/player.rb', line 22

def build(posture:, status:, direction:, parts:)
  new(
    posture: posture,
    status: status,
    direction: direction,
    default_frames: FRAMES.map { |frame| default_frame(posture, status, direction, frame, parts) },
    attack_frames:  FRAMES.map { |frame| attack_frame(posture, status, direction, frame, parts) },
  )
end