Current section
Files
Jump to
Current section
Files
lib/structs/assets/unity_material_asset.ex
defmodule Manganese.SerializationKit.Structs.UnityMaterialAsset do
@moduledoc """
"""
alias Manganese.SerializationKit.Structs
alias Manganese.SerializationKit.Enumerations
@typedoc """
"""
@type t :: %Structs.UnityMaterialAsset{
path: String.t,
id: Structs.UnityAsset.id,
name: String.t,
type: Enumerations.UnityAssetType.t
}
defstruct [
:path,
:id,
:name,
type: :material
]
# Deserialization
@doc """
"""
@spec from_map(t_external) :: t
def from_map(%{
"path" => path,
"id" => id,
"name" => name
}) do
%Structs.UnityMaterialAsset{
path: path,
id: id,
name: name
}
end
# Serialization
@type t_external :: map
@doc """
"""
@spec to_map(t) :: t_external
def to_map(%Structs.UnityMaterialAsset{
path: path,
id: id,
name: name,
type: type
}) do
%{
"path" => path,
"id" => id,
"name" => name,
"type" => Enumerations.UnityAssetType.to_integer(type)
}
end
end