struct Wakdata::Definition::Resource
- Wakdata::Definition::Resource
- Struct
- Value
- Object
Included Modules
- BSON::Serializable
- JSON::Serializable
- JSON::Serializable::Strict
- Wakdata::With::Id
- Wakdata::With::ResourceTypeId
- YAML::Serializable
Defined in:
wakdata/resource.crConstructors
- .new(id : UInt32, resource_type_id : UInt32, is_blocking : Bool, ideal_rain_range_min : UInt8, ideal_rain_range_max : UInt8, ideal_temperature_range_min : Int8, ideal_temperature_range_max : Int8, icon_gfx_id : Int32, last_evolution_step : UInt8, usable_by_heroes : Bool, ideal_rain : UInt8)
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
-
.new(bson : BSON)
Allocate an instance and copies data from a BSON struct.
Class Method Summary
-
.from_bson(bson : BSON)
NOTE See
self.new
.
Instance Method Summary
- #[](value : String)
- #icon_gfx_id : Int32
- #ideal_rain : UInt8
- #ideal_rain_range_max : UInt8
- #ideal_rain_range_min : UInt8
- #ideal_temperature_range_max : Int8
- #ideal_temperature_range_min : Int8
- #is_blocking : Bool
- #last_evolution_step : UInt8
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
- #usable_by_heroes : Bool
Instance methods inherited from module Wakdata::With::ResourceTypeId
resource_type(resource_types : Array(Wakdata::ResourceType)) : Wakdata::ResourceType | Nil
resource_type,
resource_type_id : UInt32
resource_type_id
Instance methods inherited from module Wakdata::With::Id
id : UInt32
id
Constructor Detail
def self.new(id : UInt32, resource_type_id : UInt32, is_blocking : Bool, ideal_rain_range_min : UInt8, ideal_rain_range_max : UInt8, ideal_temperature_range_min : Int8, ideal_temperature_range_max : Int8, icon_gfx_id : Int32, last_evolution_step : UInt8, usable_by_heroes : Bool, ideal_rain : UInt8)
#
def self.new(bson : BSON)
#
Allocate an instance and copies data from a BSON struct.
class User
include BSON::Serializable
property name : String
end
data = BSON.new
data["name"] = "John"
User.new(data)
Class Method Detail
Instance Method Detail
def to_bson(bson = BSON.new)
#
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson