class BuiltinTypeDef

Public Class Methods

new(name) click to toggle source
Calls superclass method TypeDef::new
# File lib/runtime.rb, line 22
def initialize name
        super nil, name
end

Public Instance Methods

bot_read() click to toggle source
# File lib/generators/bot_generator.rb, line 86
def bot_read
    case @name
    when 'Bool'
        return "Brotorift.Binary.read_bool(data)"
    when 'Byte'
        return "Brotorift.Binary.read_byte(data)"
    when 'Short'
        return "Brotorift.Binary.read_short(data)"
    when 'Int'
        return "Brotorift.Binary.read_int(data)"
    when 'Long'
        return "Brotorift.Binary.read_long(data)"
    when 'UShort'
        return "Brotorift.Binary.read_ushort(data)"
    when 'UInt'
        return "Brotorift.Binary.read_uint(data)"
    when 'ULong'
        return "Brotorift.Binary.read_ulong(data)"
    when 'Float'
        return "Brotorift.Binary.read_float(data)"
    when 'Double'
        return "Brotorift.Binary.read_double(data)"
    when 'String'
        return "Brotorift.Binary.read_string(data)"
    when 'ByteBuffer'
        return "Brotorift.Binary.read_byte_buffer(data)"
    when 'Vector2'
        return "Brotorift.Binary.read_vector2(data)"
    when 'Vector3'
        return "Brotorift.Binary.read_vector3(data)"
    when 'Color'
        return "Brotorift.Binary.read_color(data)"
    else
        throw 'Invalid operation'
    end
end
bot_reader() click to toggle source
# File lib/generators/bot_generator.rb, line 160
def bot_reader
    case @name
    when 'Bool'
        return "&Brotorift.Binary.read_bool/1"
    when 'Byte'
        return "&Brotorift.Binary.read_byte/1"
    when 'Short'
        return "&Brotorift.Binary.read_short/1"
    when 'Int'
        return "&Brotorift.Binary.read_int/1"
    when 'Long'
        return "&Brotorift.Binary.read_long/1"
    when 'UShort'
        return "&Brotorift.Binary.read_ushort/1"
    when 'UInt'
        return "&Brotorift.Binary.read_uint/1"
    when 'ULong'
        return "&Brotorift.Binary.read_ulong/1"
    when 'Float'
        return "&Brotorift.Binary.read_float/1"
    when 'Double'
        return "&Brotorift.Binary.read_double/1"
    when 'String'
        return "&Brotorift.Binary.read_string/1"
    when 'ByteBuffer'
        return "&Brotorift.Binary.read_byte_buffer/1"
    when 'Vector2'
        return "&Brotorift.Binary.read_vector2/1"
    when 'Vector3'
        return "&Brotorift.Binary.read_vector3/1"
    when 'Color'
        return "&Brotorift.Binary.read_color/1"
    else
        throw 'Invalid operation'
    end
end
bot_type() click to toggle source
# File lib/generators/bot_generator.rb, line 47
def bot_type
    case @name
    when 'Bool'
        return 'boolean()'
    when 'Byte'
        return 'byte()'
    when 'Short'
        return 'integer()'
    when 'Int'
        return 'integer()'
    when 'Long'
        return 'integer()'
    when 'UShort'
        return 'non_neg_integer()'
    when 'UInt'
        return 'non_neg_integer()'
    when 'ULong'
        return 'non_neg_integer()'
    when 'Float'
        return 'float()'
    when 'Double'
        return 'float()'
    when 'String'
        return 'String.t()'
    when 'DateTime'
        return 'DateTime.t()'
    when 'ByteBuffer'
        return 'binary()'
    when 'Vector2'
        return '{float(), float()}'
    when 'Vector3'
        return '{float(), float(), float()}'
    when 'Color'
        return '{float(), float(), float(), float()}'
    else
        return @name
    end
end
bot_write(member_name) click to toggle source
# File lib/generators/bot_generator.rb, line 123
def bot_write member_name
    case @name
    when 'Bool'
        return "Brotorift.Binary.write_bool(data, #{member_name})"
    when 'Byte'
        return "Brotorift.Binary.write_byte(data, #{member_name})"
    when 'Short'
        return "Brotorift.Binary.write_short(data, #{member_name})"
    when 'Int'
        return "Brotorift.Binary.write_int(data, #{member_name})"
    when 'Long'
        return "Brotorift.Binary.write_long(data, #{member_name})"
    when 'UShort'
        return "Brotorift.Binary.write_ushort(data, #{member_name})"
    when 'UInt'
        return "Brotorift.Binary.write_uint(data, #{member_name})"
    when 'ULong'
        return "Brotorift.Binary.write_ulong(data, #{member_name})"
    when 'Float'
        return "Brotorift.Binary.write_float(data, #{member_name})"
    when 'Double'
        return "Brotorift.Binary.write_double(data, #{member_name})"
    when 'String'
        return "Brotorift.Binary.write_string(data, #{member_name})"
    when 'ByteBuffer'
        return "Brotorift.Binary.write_byte_buffer(data, #{member_name})"
    when 'Vector2'
        return "Brotorift.Binary.write_vector2(data, #{member_name})"
    when 'Vector3'
        return "Brotorift.Binary.write_vector3(data, #{member_name})"
    when 'Color'
        return "Brotorift.Binary.write_color(data, #{member_name})"
    else
        throw 'Invalid operation'
    end
end
bot_writer() click to toggle source
# File lib/generators/bot_generator.rb, line 197
def bot_writer
    case @name
    when 'Bool'
        return "&Brotorift.Binary.write_bool/2"
    when 'Byte'
        return "&Brotorift.Binary.write_byte/2"
    when 'Short'
        return "&Brotorift.Binary.write_short/2"
    when 'Int'
        return "&Brotorift.Binary.write_int/2"
    when 'Long'
        return "&Brotorift.Binary.write_long/2"
    when 'UShort'
        return "&Brotorift.Binary.write_ushort/2"
    when 'UInt'
        return "&Brotorift.Binary.write_uint/2"
    when 'ULong'
        return "&Brotorift.Binary.write_ulong/2"
    when 'Float'
        return "&Brotorift.Binary.write_float/2"
    when 'Double'
        return "&Brotorift.Binary.write_double/2"
    when 'String'
        return "&Brotorift.Binary.write_string/2"
    when 'ByteBuffer'
        return "&Brotorift.Binary.write_byte_buffer/2"
    when 'Vector2'
        return "&Brotorift.Binary.write_vector2/2"
    when 'Vector3'
        return "&Brotorift.Binary.write_vector3/2"
    when 'Color'
        return "&Brotorift.Binary.write_color/2"
    else
        throw 'Invalid operation'
    end
end
elixir_read() click to toggle source
# File lib/generators/elixir_server_generator.rb, line 86
def elixir_read
    case @name
    when 'Bool'
        return "Brotorift.Binary.read_bool(data)"
    when 'Byte'
        return "Brotorift.Binary.read_byte(data)"
    when 'Short'
        return "Brotorift.Binary.read_short(data)"
    when 'Int'
        return "Brotorift.Binary.read_int(data)"
    when 'Long'
        return "Brotorift.Binary.read_long(data)"
    when 'UShort'
        return "Brotorift.Binary.read_ushort(data)"
    when 'UInt'
        return "Brotorift.Binary.read_uint(data)"
    when 'ULong'
        return "Brotorift.Binary.read_ulong(data)"
    when 'Float'
        return "Brotorift.Binary.read_float(data)"
    when 'Double'
        return "Brotorift.Binary.read_double(data)"
    when 'String'
        return "Brotorift.Binary.read_string(data)"
    when 'ByteBuffer'
        return "Brotorift.Binary.read_byte_buffer(data)"
    when 'Vector2'
        return "Brotorift.Binary.read_vector2(data)"
    when 'Vector3'
        return "Brotorift.Binary.read_vector3(data)"
    when 'Color'
        return "Brotorift.Binary.read_color(data)"
    else
        throw 'Invalid operation'
    end
end
elixir_reader() click to toggle source
# File lib/generators/elixir_server_generator.rb, line 160
def elixir_reader
    case @name
    when 'Bool'
        return "&Brotorift.Binary.read_bool/1"
    when 'Byte'
        return "&Brotorift.Binary.read_byte/1"
    when 'Short'
        return "&Brotorift.Binary.read_short/1"
    when 'Int'
        return "&Brotorift.Binary.read_int/1"
    when 'Long'
        return "&Brotorift.Binary.read_long/1"
    when 'UShort'
        return "&Brotorift.Binary.read_ushort/1"
    when 'UInt'
        return "&Brotorift.Binary.read_uint/1"
    when 'ULong'
        return "&Brotorift.Binary.read_ulong/1"
    when 'Float'
        return "&Brotorift.Binary.read_float/1"
    when 'Double'
        return "&Brotorift.Binary.read_double/1"
    when 'String'
        return "&Brotorift.Binary.read_string/1"
    when 'ByteBuffer'
        return "&Brotorift.Binary.read_byte_buffer/1"
    when 'Vector2'
        return "&Brotorift.Binary.read_vector2/1"
    when 'Vector3'
        return "&Brotorift.Binary.read_vector3/1"
    when 'Color'
        return "&Brotorift.Binary.read_color/1"
    else
        throw 'Invalid operation'
    end
end
elixir_type() click to toggle source
# File lib/generators/elixir_server_generator.rb, line 47
def elixir_type
    case @name
    when 'Bool'
        return 'boolean()'
    when 'Byte'
        return 'byte()'
    when 'Short'
        return 'integer()'
    when 'Int'
        return 'integer()'
    when 'Long'
        return 'integer()'
    when 'UShort'
        return 'non_neg_integer()'
    when 'UInt'
        return 'non_neg_integer()'
    when 'ULong'
        return 'non_neg_integer()'
    when 'Float'
        return 'float()'
    when 'Double'
        return 'float()'
    when 'String'
        return 'String.t()'
    when 'DateTime'
        return 'DateTime.t()'
    when 'ByteBuffer'
        return 'binary()'
    when 'Vector2'
        return '{float(), float()}'
    when 'Vector3'
        return '{float(), float(), float()}'
    when 'Color'
        return '{float(), float(), float(), float()}'
    else
        return @name
    end
end
elixir_write(member_name) click to toggle source
# File lib/generators/elixir_server_generator.rb, line 123
def elixir_write member_name
    case @name
    when 'Bool'
        return "Brotorift.Binary.write_bool(data, #{member_name})"
    when 'Byte'
        return "Brotorift.Binary.write_byte(data, #{member_name})"
    when 'Short'
        return "Brotorift.Binary.write_short(data, #{member_name})"
    when 'Int'
        return "Brotorift.Binary.write_int(data, #{member_name})"
    when 'Long'
        return "Brotorift.Binary.write_long(data, #{member_name})"
    when 'UShort'
        return "Brotorift.Binary.write_ushort(data, #{member_name})"
    when 'UInt'
        return "Brotorift.Binary.write_uint(data, #{member_name})"
    when 'ULong'
        return "Brotorift.Binary.write_ulong(data, #{member_name})"
    when 'Float'
        return "Brotorift.Binary.write_float(data, #{member_name})"
    when 'Double'
        return "Brotorift.Binary.write_double(data, #{member_name})"
    when 'String'
        return "Brotorift.Binary.write_string(data, #{member_name})"
    when 'ByteBuffer'
        return "Brotorift.Binary.write_byte_buffer(data, #{member_name})"
    when 'Vector2'
        return "Brotorift.Binary.write_vector2(data, #{member_name})"
    when 'Vector3'
        return "Brotorift.Binary.write_vector3(data, #{member_name})"
    when 'Color'
        return "Brotorift.Binary.write_color(data, #{member_name})"
    else
        throw 'Invalid operation'
    end
end
elixir_writer() click to toggle source
# File lib/generators/elixir_server_generator.rb, line 197
def elixir_writer
    case @name
    when 'Bool'
        return "&Brotorift.Binary.write_bool/2"
    when 'Byte'
        return "&Brotorift.Binary.write_byte/2"
    when 'Short'
        return "&Brotorift.Binary.write_short/2"
    when 'Int'
        return "&Brotorift.Binary.write_int/2"
    when 'Long'
        return "&Brotorift.Binary.write_long/2"
    when 'UShort'
        return "&Brotorift.Binary.write_ushort/2"
    when 'UInt'
        return "&Brotorift.Binary.write_uint/2"
    when 'ULong'
        return "&Brotorift.Binary.write_ulong/2"
    when 'Float'
        return "&Brotorift.Binary.write_float/2"
    when 'Double'
        return "&Brotorift.Binary.write_double/2"
    when 'String'
        return "&Brotorift.Binary.write_string/2"
    when 'ByteBuffer'
        return "&Brotorift.Binary.write_byte_buffer/2"
    when 'Vector2'
        return "&Brotorift.Binary.write_vector2/2"
    when 'Vector3'
        return "&Brotorift.Binary.write_vector3/2"
    when 'Color'
        return "&Brotorift.Binary.write_color/2"
    else
        throw 'Invalid operation'
    end
end
scala() click to toggle source
# File lib/generators/scala_server_generator.rb, line 6
def scala
        case @name
        when 'Bool'
                return 'Boolean'
        when 'ByteBuffer'
                return 'ByteString'
        else
                return @name
        end
end
unity() click to toggle source
# File lib/generators/unity_client_generator.rb, line 6
def unity
        case @name
        when 'UShort'
                return 'ushort'
        when 'UInt'
                return 'uint'
        when 'ULong'
                return 'ulong'
        when 'DateTime'
                return 'DateTime'
        when 'ByteBuffer'
                return 'byte[]'
        when 'List'
                return 'List'
        when 'Set'
                return 'HashSet'
        when 'Map'
                return 'Dictionary'
        when 'Vector2', 'Vector3', 'Color'
                return @name
        when 'Matrix4'
                return 'Matrix4x4'
        else
                return @name.decapitalize
        end
end