class WolfRpg::Command::Picture

Public Instance Methods

filename() click to toggle source
# File lib/wolfrpg/command.rb, line 135
def filename
  if type != :file && type != :window_file
    raise "picture type #{type} has no filename"
  end
  string_args[0]
end
filename=(value) click to toggle source
# File lib/wolfrpg/command.rb, line 141
def filename=(value)
  if type != :file && type != :window_file
    raise "picture type #{type} has no filename"
  end
  string_args[0] = value
end
num() click to toggle source
# File lib/wolfrpg/command.rb, line 113
def num
  args[1]
end
text() click to toggle source
# File lib/wolfrpg/command.rb, line 117
def text
  if type != :text
    raise "picture type #{type} has no text"
  end
  return '' if string_args.empty?
  string_args[0]
end
text=(value) click to toggle source
# File lib/wolfrpg/command.rb, line 124
def text=(value)
  if type != :text
    raise "picture type #{type} has no text"
  end
  if string_args.empty?
    string_args << value
  else
    string_args[0] = value
  end
end
type() click to toggle source
# File lib/wolfrpg/command.rb, line 96
def type
  case (args[0] >> 4) & 0x07
  when 0
    :file
  when 1
    :file_string
  when 2
    :text
  when 3
    :window_file
  when 4
    :window_string
  else
    nil
  end
end