177 lines
4.4 KiB
C#
177 lines
4.4 KiB
C#
using ProtoBuf;
|
|
|
|
using System.Collections.Generic;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using Fantasy;
|
|
using Fantasy.Network.Interface;
|
|
using Fantasy.Serialize;
|
|
// ReSharper disable InconsistentNaming
|
|
// ReSharper disable RedundantUsingDirective
|
|
// ReSharper disable RedundantOverriddenMember
|
|
// ReSharper disable PartialTypeWithSinglePart
|
|
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
// ReSharper disable MemberCanBePrivate.Global
|
|
// ReSharper disable CheckNamespace
|
|
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
|
#pragma warning disable CS8618
|
|
|
|
namespace Fantasy
|
|
{
|
|
[ProtoContract]
|
|
public partial class Vector3Info : AMessage, IProto
|
|
{
|
|
public static Vector3Info Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Vector3Info>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
x = default;
|
|
y = default;
|
|
z = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Vector3Info>(this);
|
|
#endif
|
|
}
|
|
[ProtoMember(1)]
|
|
public float x { get; set; }
|
|
[ProtoMember(2)]
|
|
public float y { get; set; }
|
|
[ProtoMember(3)]
|
|
public float z { get; set; }
|
|
}
|
|
[ProtoContract]
|
|
public partial class Vector2Info : AMessage, IProto
|
|
{
|
|
public static Vector2Info Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Vector2Info>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
x = default;
|
|
y = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Vector2Info>(this);
|
|
#endif
|
|
}
|
|
[ProtoMember(1)]
|
|
public float x { get; set; }
|
|
[ProtoMember(2)]
|
|
public float y { get; set; }
|
|
}
|
|
[ProtoContract]
|
|
public partial class QuaternionInfo : AMessage, IProto
|
|
{
|
|
public static QuaternionInfo Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<QuaternionInfo>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
x = default;
|
|
y = default;
|
|
z = default;
|
|
w = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<QuaternionInfo>(this);
|
|
#endif
|
|
}
|
|
[ProtoMember(1)]
|
|
public float x { get; set; }
|
|
[ProtoMember(2)]
|
|
public float y { get; set; }
|
|
[ProtoMember(3)]
|
|
public float z { get; set; }
|
|
[ProtoMember(4)]
|
|
public float w { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 玩家当前使用钓组信息
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class GearInfo : AMessage, IProto
|
|
{
|
|
public static GearInfo Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<GearInfo>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Rod = default;
|
|
Rigs.Clear();
|
|
Position = default;
|
|
Rotation = default;
|
|
Propertys.Clear();
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<GearInfo>(this);
|
|
#endif
|
|
}
|
|
[ProtoMember(1)]
|
|
public long Rod { get; set; }
|
|
[ProtoMember(2)]
|
|
public List<long> Rigs = new List<long>();
|
|
[ProtoMember(3)]
|
|
public Vector3Info Position { get; set; }
|
|
[ProtoMember(4)]
|
|
public Vector3Info Rotation { get; set; }
|
|
[ProtoMember(5)]
|
|
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
|
}
|
|
[ProtoContract]
|
|
public partial class UnitStateInfo : AMessage, IProto
|
|
{
|
|
public static UnitStateInfo Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<UnitStateInfo>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
State = default;
|
|
Propertys.Clear();
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<UnitStateInfo>(this);
|
|
#endif
|
|
}
|
|
[ProtoMember(1)]
|
|
public int State { get; set; }
|
|
[ProtoMember(2)]
|
|
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
|
}
|
|
[ProtoContract]
|
|
public partial class MapUnitInfo : AMessage, IProto
|
|
{
|
|
public static MapUnitInfo Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<MapUnitInfo>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Id = default;
|
|
RoleInfo = default;
|
|
Position = default;
|
|
Rotation = default;
|
|
State = default;
|
|
Gears.Clear();
|
|
Propertys.Clear();
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<MapUnitInfo>(this);
|
|
#endif
|
|
}
|
|
[ProtoMember(1)]
|
|
public long Id { get; set; }
|
|
[ProtoMember(2)]
|
|
public RoleSimpleInfo RoleInfo { get; set; }
|
|
[ProtoMember(3)]
|
|
public Vector3Info Position { get; set; }
|
|
[ProtoMember(4)]
|
|
public Vector3Info Rotation { get; set; }
|
|
[ProtoMember(5)]
|
|
public UnitStateInfo State { get; set; }
|
|
[ProtoMember(6)]
|
|
public List<GearInfo> Gears = new List<GearInfo>();
|
|
[ProtoMember(7)]
|
|
public List<KeyValueInt64> Propertys = new List<KeyValueInt64>();
|
|
}
|
|
}
|