Supercell.GUT/Supercell.GUT.Logic/Avatar/LogicClientAvatar.cs
BreadDEV 281d2789ea [v0.1.0] database implementation
not finished. early wip state
2024-03-06 22:00:12 +07:00

80 lines
2.4 KiB
C#

using Supercell.GUT.Logic.Base;
using Supercell.GUT.Logic.Player;
using Supercell.GUT.Titan.Logic.DataStream;
using Supercell.GUT.Titan.Logic.Math;
using Supercell.GUT.Titan.Logic.Util;
namespace Supercell.GUT.Logic.Avatar;
public class LogicClientAvatar : LogicBase
{
public LogicLong Id { get; set; }
public int ActiveMission { get; set; }
public string Name { get; set; }
public string AvatarCode { get; set; }
public LogicArrayList<LogicAvatarGame> AvatarGames { get; set; }
public LogicArrayList<int> MissionStatus { get; set; }
public LogicPlayerAttributes PlayerAttributes { get; set; }
public LogicInventory Inventory { get; set; }
public LogicPlayerStats PlayerStats { get; set; }
public int TutorialFlags { get; set; }
public LogicClientAvatar() : base(20486)
{
this.Id = new LogicLong();
this.ActiveMission = -1;
this.Name = string.Empty;
this.AvatarCode = string.Empty;
this.AvatarGames = new LogicArrayList<LogicAvatarGame>();
this.MissionStatus = new LogicArrayList<int>();
this.PlayerAttributes = new LogicPlayerAttributes(20486);
this.Inventory = new LogicInventory(20486);
this.PlayerStats = new LogicPlayerStats(20486);
}
public override void Destruct()
{
base.Destruct();
}
public override void Decode(ByteStream byteStream)
{
base.Decode(byteStream);
}
public override void Encode(ChecksumEncoder checksumEncoder)
{
base.Encode(checksumEncoder);
checksumEncoder.WriteLong(this.Id);
checksumEncoder.WriteInt(this.ActiveMission);
checksumEncoder.WriteString(this.Name);
checksumEncoder.WriteString(this.AvatarCode);
checksumEncoder.WriteInt(this.AvatarGames.Size());
for (int i = 0; i < this.AvatarGames.Size(); i++)
{
this.AvatarGames[i].Encode(checksumEncoder);
}
checksumEncoder.WriteInt(this.MissionStatus.Size());
for (int i = 0; i < this.MissionStatus.Size(); i++)
{
checksumEncoder.WriteInt(this.MissionStatus[i]);
}
this.PlayerAttributes.Encode(checksumEncoder);
this.Inventory.Encode(checksumEncoder);
this.PlayerStats.Encode(checksumEncoder);
checksumEncoder.WriteInt(this.TutorialFlags);
}
public void SetTutorialFlags(int tutorialFlags)
{
this.TutorialFlags |= tutorialFlags;
}
}