Sha256: 9b7b97c9eb19b805ff282dbb14f6d442052610bb7717753ac15209cb12626431

Contents?: true

Size: 816 Bytes

Versions: 6

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true

require 'mikunyan/object_value'

module Mikunyan
  # Class for representing decoded base object
  class BaseObject < Mikunyan::ObjectValue
    attr_accessor :object_entry

    def path_id
      @object_entry&.path_id
    end

    def object_name
      @attr['m_Name']&.value
    end
  end

  module CustomTypes
    def self.get_custom_type(name, class_id = nil)
      class_id ||= Mikunyan::Constants::CLASS_NAME2ID[name]
      @custom_types&.[]([class_id, name]) || Mikunyan::BaseObject
    end

    def self.set_custom_type(klass, name, class_id = nil)
      class_id ||= Mikunyan::Constants::CLASS_NAME2ID[name]
      @custom_types ||= {}
      @custom_types[[class_id, name].freeze] = klass
    end
  end
end

require 'mikunyan/types/text_asset'
require 'mikunyan/types/texture2d'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mikunyan-3.9.12 lib/mikunyan/base_object.rb
mikunyan-3.9.11 lib/mikunyan/base_object.rb
mikunyan-3.9.10 lib/mikunyan/base_object.rb
mikunyan-3.9.9 lib/mikunyan/base_object.rb
mikunyan-3.9.8 lib/mikunyan/base_object.rb
mikunyan-3.9.7 lib/mikunyan/base_object.rb