//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using Ajuna.NetApi.Attributes;
using Ajuna.NetApi.Model.Types.Base;
using Ajuna.NetApi.Model.Types.Metadata.V14;
using System.Collections.Generic;


namespace Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.avatar
{
    
    
    /// <summary>
    /// >> 418 - Composite[pallet_ajuna_awesome_avatars.types.avatar.Avatar]
    /// </summary>
    [AjunaNodeType(TypeDefEnum.Composite)]
    public sealed class Avatar : BaseType
    {
        
        /// <summary>
        /// >> season_id
        /// </summary>
        private Ajuna.NetApi.Model.Types.Primitive.U16 _seasonId;
        
        /// <summary>
        /// >> dna
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT1 _dna;
        
        /// <summary>
        /// >> souls
        /// </summary>
        private Ajuna.NetApi.Model.Types.Primitive.U32 _souls;
        
        public Ajuna.NetApi.Model.Types.Primitive.U16 SeasonId
        {
            get
            {
                return this._seasonId;
            }
            set
            {
                this._seasonId = value;
            }
        }
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT1 Dna
        {
            get
            {
                return this._dna;
            }
            set
            {
                this._dna = value;
            }
        }
        
        public Ajuna.NetApi.Model.Types.Primitive.U32 Souls
        {
            get
            {
                return this._souls;
            }
            set
            {
                this._souls = value;
            }
        }
        
        public override string TypeName()
        {
            return "Avatar";
        }
        
        public override byte[] Encode()
        {
            var result = new List<byte>();
            result.AddRange(SeasonId.Encode());
            result.AddRange(Dna.Encode());
            result.AddRange(Souls.Encode());
            return result.ToArray();
        }
        
        public override void Decode(byte[] byteArray, ref int p)
        {
            var start = p;
            SeasonId = new Ajuna.NetApi.Model.Types.Primitive.U16();
            SeasonId.Decode(byteArray, ref p);
            Dna = new Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec.BoundedVecT1();
            Dna.Decode(byteArray, ref p);
            Souls = new Ajuna.NetApi.Model.Types.Primitive.U32();
            Souls.Decode(byteArray, ref p);
            TypeSize = p - start;
        }
    }
}
