Skip to content

GameCore.BaseType ​

ActorScaleAggregator 双端 ​

命名空间 GameCore.BaseType

csharp
public class ActorScaleAggregator : Dictionary<object, float>

构造函数 ​

ActorScaleAggregator 双端 ​

csharp
public ActorScaleAggregator()

方法 ​

GetFinal 双端 ​

csharp
public float GetFinal()

Angle 双端 ​

命名空间 GameCore.BaseType

csharp
public struct Angle : ICommandTarget, IComparable<Angle>

Angle based on degree

  • degree —

构造函数 ​

Angle 双端 ​

csharp
public Angle(float degree)

Angle based on degree

  • degree —

属性 ​

Normal 双端 ​

csharp
public readonly float Normal { get; }

Minor 双端 ​

csharp
public readonly float Minor { get; }

Radian 双端 ​

csharp
public readonly double Radian { get; }

Zero 双端 ​

csharp
public static Angle Zero { get; }

Half 双端 ​

csharp
public static Angle Half { get; }

Full 双端 ​

csharp
public static Angle Full { get; }

方法 ​

ScaledTargetPosition 双端 ​

csharp
public readonly ScenePoint ScaledTargetPosition(ITarget source, float range)

ToVector2 双端 ​

csharp
public readonly Vector2 ToVector2()

FromVector2 双端 ​

csharp
public static Angle FromVector2(Vector2 vector)

Normalize 双端 ​

csharp
public void Normalize()

IsInArc 双端 ​

csharp
public readonly bool IsInArc(Angle targetAngle, Angle arc)

DifferenceMinor 双端 ​

csharp
public readonly Angle DifferenceMinor(Angle targetAngle)

FromDegree 双端 ​

csharp
public static Angle FromDegree(float degree)

FromRadian 双端 ​

csharp
public static Angle FromRadian(double radian)

Equals 双端 ​

csharp
public override readonly bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override readonly int GetHashCode()

ToString 双端 ​

csharp
public override readonly string ToString()

CompareTo 双端 ​

csharp
public readonly int CompareTo(Angle other)

operator + 双端 ​

csharp
public static Angle operator +(Angle a, Angle b)

operator - 双端 ​

csharp
public static Angle operator -(Angle a, Angle b)

operator - 双端 ​

csharp
public static Angle operator -(Angle a)

operator == 双端 ​

csharp
public static bool operator ==(Angle a, Angle b)

operator != 双端 ​

csharp
public static bool operator !=(Angle a, Angle b)

operator < 双端 ​

csharp
public static bool operator <(Angle a, Angle b)

operator > 双端 ​

csharp
public static bool operator >(Angle a, Angle b)

operator <= 双端 ​

csharp
public static bool operator <=(Angle a, Angle b)

operator >= 双端 ​

csharp
public static bool operator >=(Angle a, Angle b)

implicit operator 双端 ​

csharp
public static Angle implicit operator(float degree)

implicit operator 双端 ​

csharp
public static float implicit operator(Angle a)

AttachedObject 双端 ​

命名空间 GameCore.BaseType

csharp
public abstract class AttachedObject : DisposableObject, IActorScope, IActorScopeOwner, IActorScopeContext, IComparable, IDisplayInfo, IEventSender, IPropertyOwner<PropertyAttachedObject>, IPropertyOwner, ISyncIdOwner, IAttachedObject, IDisposable

Directly attached to the unit, such as abilities, buffs. Can be added and removed. Can be in multiple states at the same time. Can modify the unit's properties. Usually has Link and Cache.

构造函数 ​

AttachedObject 双端 ​

csharp
public AttachedObject(Unit host)

属性 ​

Host 双端 ​

csharp
public Unit Host { get; set; }

ModSeed 双端 ​

csharp
public int ModSeed { get; }

IsActivated 双端 ​

csharp
public bool IsActivated { get; }

IsEnabled 双端 ​

csharp
public bool IsEnabled { get; }

IsInstanceEnabled 双端 ​

csharp
public bool IsInstanceEnabled { get; }

IsLinkEnabled 双端 ​

csharp
public abstract bool IsLinkEnabled { get; }

IsHidden 双端 ​

csharp
public bool IsHidden { get; }

ModificationManager 双端 ​

csharp
public ModificationManager? ModificationManager { get; set; }

StackInternal 双端 ​

csharp
protected virtual uint StackInternal { get; }

ClientActors 仅客户端 ​

csharp
public HashSet<Actor>? ClientActors { get; }

DisplayCache 双端 ​

csharp
public abstract IDisplayInfoData DisplayCache { get; }

AggregatorWeakReference 双端 ​

csharp
public WeakReference<EventAggregator> AggregatorWeakReference { get; }

SyncIdType 双端 ​

csharp
public abstract SyncIdType SyncIdType { get; }

SyncId 仅服务端 ​

csharp
public virtual int SyncId { get; }

方法 ​

HasState 双端 ​

csharp
public abstract bool HasState(AttachedObjectState state)

ToString 双端 ​

csharp
public override string? ToString()

DisposeManaged 双端 ​

csharp
protected override void DisposeManaged()

CompareTo 双端 ​

csharp
public int CompareTo(object? obj)

Publish 双端 ​

csharp
public void Publish<TEvent>(TEvent eventToPublish)

GetPublisher 双端 ​

csharp
public Action<TEvent>? GetPublisher<TEvent>()

ReplicateFromKeyValue 仅客户端 ​

csharp
public abstract bool ReplicateFromKeyValue(Enum propertyEnum, ReadOnlySpan<byte> value, bool isHostReplicating = false)

GetProperty 双端 ​

csharp
public TValue? GetProperty<TValue>(PropertyAttachedObject property)

RefreshStatesAndModifications 仅服务端 ​

csharp
public void RefreshStatesAndModifications(bool forced = false)

AddState 仅服务端 ​

csharp
public void AddState(AttachedObjectState state)

RemoveState 仅服务端 ​

csharp
public void RemoveState(AttachedObjectState state)

SetProperty 仅服务端 ​

csharp
public void SetProperty<TValue>(PropertyAttachedObject property, TValue value)

AddProperty 仅服务端 ​

csharp
public void AddProperty(PropertyAttachedObject property, double value)

事件 ​

OnRemoved 双端 ​

csharp
public event Action? OnRemoved

OnAttachedObjectStateChanged 双端 ​

csharp
public event Action<AttachedObjectState>? OnAttachedObjectStateChanged

OnBecomeDisabled 仅服务端 ​

csharp
public event Action? OnBecomeDisabled

OnBecomeEnabled 仅服务端 ​

csharp
public event Action? OnBecomeEnabled

字段 ​

OnAttachedObjectStateChangedHandler 双端 ​

csharp
protected Action<AttachedObjectState>? OnAttachedObjectStateChangedHandler

_clientActors 仅客户端 ​

csharp
protected HashSet<Actor>? _clientActors

aggregator 双端 ​

csharp
protected EventAggregator? aggregator

StateCounter 仅服务端 ​

csharp
protected StateCounter<AttachedObjectState> StateCounter

AttachedObjectState 双端 ​

命名空间 GameCore.BaseType

csharp
public enum AttachedObjectState

枚举值 ​

  • Deactivated
  • Disabled
  • Hidden

AttachedObjectType 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct AttachedObjectType : IGameClass, IExtendableEnum<AttachedObjectType>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(AttachedObjectType left, AttachedObjectType right)

operator != 双端 ​

csharp
public static bool operator !=(AttachedObjectType left, AttachedObjectType right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

AttachedType 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct AttachedType : IGameClass, IExtendableEnum<AttachedType>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(AttachedType left, AttachedType right)

operator != 双端 ​

csharp
public static bool operator !=(AttachedType left, AttachedType right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

Ability 双端 ​

csharp
public static readonly AttachedType Ability

Buff 双端 ​

csharp
public static readonly AttachedType Buff

Behavior 双端 ​

csharp
public static readonly AttachedType Behavior

Response 双端 ​

csharp
public static readonly AttachedType Response

Modifier 双端 ​

csharp
public static readonly AttachedType Modifier

BearingSnapshot 双端 ​

命名空间 GameCore.BaseType

csharp
public class BearingSnapshot

构造函数 ​

BearingSnapshot 双端 ​

csharp
public BearingSnapshot()

属性 ​

Position 双端 ​

csharp
public ScenePoint Position { get; set; }

Z 双端 ​

csharp
public double Z { get; set; }

Facing 双端 ​

csharp
public Angle Facing { get; set; }

Will be normalized to 0-360

IgnoreTerrainHeight 双端 ​

csharp
public bool IgnoreTerrainHeight { get; set; }

方法 ​

SetPosition 双端 ​

csharp
protected internal bool SetPosition(IScenePoint scenePoint)

ZeroOut 双端 ​

csharp
public void ZeroOut(bool includeZ = false)

ToString 双端 ​

csharp
public override string ToString()

CmdError 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct CmdError : IGameClass, IExtendableEnum<CmdError>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

operator true 双端 ​

csharp
public static bool operator true(CmdError _)

operator false 双端 ​

csharp
public static bool operator false(CmdError _)

operator ! 双端 ​

csharp
public static bool operator !(CmdError _)

operator & 双端 ​

csharp
public static CmdError operator &(CmdError x, CmdError y)

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(CmdError left, CmdError right)

operator != 双端 ​

csharp
public static bool operator !=(CmdError left, CmdError right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

implicit operator 双端 ​

csharp
public static CmdResult implicit operator(CmdError e)

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

NotSupported 双端 ​

csharp
public static readonly CmdError NotSupported

Error 双端 ​

csharp
public static readonly CmdError Error

AbilityNotFound 双端 ​

csharp
public static readonly CmdError AbilityNotFound

MustTargetUnit 双端 ​

csharp
public static readonly CmdError MustTargetUnit

MustTargetEntity 双端 ​

csharp
public static readonly CmdError MustTargetEntity

MustTargetItem 双端 ​

csharp
public static readonly CmdError MustTargetItem

NotStarted 双端 ​

csharp
public static readonly CmdError NotStarted

NoOrderQueue 双端 ​

csharp
public static readonly CmdError NoOrderQueue

NoComponentToHandleOrder 双端 ​

csharp
public static readonly CmdError NoComponentToHandleOrder

NoValidAttackAbility 双端 ​

csharp
public static readonly CmdError NoValidAttackAbility

NoTriggerAbility 双端 ​

csharp
public static readonly CmdError NoTriggerAbility

NotEnoughTarget 双端 ​

csharp
public static readonly CmdError NotEnoughTarget

NotEnoughRoomToPlace 双端 ​

csharp
public static readonly CmdError NotEnoughRoomToPlace

NotEnoughChildrenToExecute 双端 ​

csharp
public static readonly CmdError NotEnoughChildrenToExecute

NothingToExecute 双端 ​

csharp
public static readonly CmdError NothingToExecute

MustTargetCertainUnit 双端 ​

csharp
public static readonly CmdError MustTargetCertainUnit

CanOnlyTargetUnitWithInventory 双端 ​

csharp
public static readonly CmdError CanOnlyTargetUnitWithInventory

CannotFindCaster 双端 ​

csharp
public static readonly CmdError CannotFindCaster

CannotIssueThatOrder 双端 ​

csharp
public static readonly CmdError CannotIssueThatOrder

CannotTargetCertainUnit 双端 ​

csharp
public static readonly CmdError CannotTargetCertainUnit

CannotControlThatUnit 双端 ​

csharp
public static readonly CmdError CannotControlThatUnit

CannotControlThatAbility 双端 ​

csharp
public static readonly CmdError CannotControlThatAbility

CannotControlThatItem 双端 ​

csharp
public static readonly CmdError CannotControlThatItem

CannotControlThatSlot 双端 ​

csharp
public static readonly CmdError CannotControlThatSlot

CannotTakeThatItem 双端 ​

csharp
public static readonly CmdError CannotTakeThatItem

CannotDropThatItem 双端 ​

csharp
public static readonly CmdError CannotDropThatItem

CannotSeeTarget 双端 ​

csharp
public static readonly CmdError CannotSeeTarget

CannotMove 双端 ​

csharp
public static readonly CmdError CannotMove

CannotMoveWhileDead 双端 ​

csharp
public static readonly CmdError CannotMoveWhileDead

CannotMoveToTarget 双端 ​

csharp
public static readonly CmdError CannotMoveToTarget

CannotTurn 双端 ​

csharp
public static readonly CmdError CannotTurn

CannotTurnToTarget 双端 ​

csharp
public static readonly CmdError CannotTurnToTarget

CannotTurnWhileDead 双端 ​

csharp
public static readonly CmdError CannotTurnWhileDead

CannotTurnWhenSpeedIsZero 双端 ​

csharp
public static readonly CmdError CannotTurnWhenSpeedIsZero

CannotUseHiddenAbility 双端 ​

csharp
public static readonly CmdError CannotUseHiddenAbility

CannotUseDisabledAbility 双端 ​

csharp
public static readonly CmdError CannotUseDisabledAbility

TargetIsDead 双端 ​

csharp
public static readonly CmdError TargetIsDead

TargetIsRemoved 双端 ​

csharp
public static readonly CmdError TargetIsRemoved

TargetIsInAnotherScene 双端 ​

csharp
public static readonly CmdError TargetIsInAnotherScene

TargetSceneIsNotLoaded 双端 ​

csharp
public static readonly CmdError TargetSceneIsNotLoaded

TargetIsOutOfRange 双端 ​

csharp
public static readonly CmdError TargetIsOutOfRange

TargetIsTooClose 双端 ​

csharp
public static readonly CmdError TargetIsTooClose

InventoryIsFull 双端 ​

csharp
public static readonly CmdError InventoryIsFull

NoIntermediateUnit 双端 ​

csharp
public static readonly CmdError NoIntermediateUnit

AlreadyCancelled 双端 ​

csharp
public static readonly CmdError AlreadyCancelled

AlreadyIssued 双端 ​

csharp
public static readonly CmdError AlreadyIssued

AlreadyQueued 双端 ​

csharp
public static readonly CmdError AlreadyQueued

AlreadyExecuted 双端 ​

csharp
public static readonly CmdError AlreadyExecuted

AlreadyToggled 双端 ​

csharp
public static readonly CmdError AlreadyToggled

CasterIsRemoved 双端 ​

csharp
public static readonly CmdError CasterIsRemoved

CasterIsDead 双端 ​

csharp
public static readonly CmdError CasterIsDead

CannotTargetThat 双端 ​

csharp
public static readonly CmdError CannotTargetThat

CasterCannotUseAbility 双端 ​

csharp
public static readonly CmdError CasterCannotUseAbility

IsInCooldown 双端 ​

csharp
public static readonly CmdError IsInCooldown

IsDisabled 双端 ​

csharp
public static readonly CmdError IsDisabled

NotEnoughCharges 双端 ​

csharp
public static readonly CmdError NotEnoughCharges

NotEnoughResource 双端 ​

csharp
public static readonly CmdError NotEnoughResource

TooMuchResource 双端 ​

csharp
public static readonly CmdError TooMuchResource

CannotPlaceThere 双端 ​

csharp
public static readonly CmdError CannotPlaceThere

LaunchSiteUnitIsRemoved 双端 ​

csharp
public static readonly CmdError LaunchSiteUnitIsRemoved

InvalidUnitType 双端 ​

csharp
public static readonly CmdError InvalidUnitType

InvalidPlayer 双端 ​

csharp
public static readonly CmdError InvalidPlayer

InvalidAbilityType 双端 ​

csharp
public static readonly CmdError InvalidAbilityType

InvalidBuffType 双端 ​

csharp
public static readonly CmdError InvalidBuffType

InvalidCommandData 双端 ​

csharp
public static readonly CmdError InvalidCommandData

InvalidMoverData 双端 ​

csharp
public static readonly CmdError InvalidMoverData

InvalidCountData 双端 ​

csharp
public static readonly CmdError InvalidCountData

InvalidFacingData 双端 ​

csharp
public static readonly CmdError InvalidFacingData

InvalidSetData 双端 ​

csharp
public static readonly CmdError InvalidSetData

InvalidVectorMoveTarget 双端 ​

csharp
public static readonly CmdError InvalidVectorMoveTarget

InvalidItemType 双端 ​

csharp
public static readonly CmdError InvalidItemType

InvalidRange 双端 ​

csharp
public static readonly CmdError InvalidRange

InvalidTarget 双端 ​

csharp
public static readonly CmdError InvalidTarget

InvalidMissileUnit 双端 ​

csharp
public static readonly CmdError InvalidMissileUnit

InvalidLaunchLocationData 双端 ​

csharp
public static readonly CmdError InvalidLaunchLocationData

InvalidTargetData 双端 ​

csharp
public static readonly CmdError InvalidTargetData

ItemIsNotUseable 双端 ​

csharp
public static readonly CmdError ItemIsNotUseable

ItemDoesNotHaveAbility 双端 ​

csharp
public static readonly CmdError ItemDoesNotHaveAbility

MovementSuppressed 双端 ​

csharp
public static readonly CmdError MovementSuppressed

TurningSuppressed 双端 ​

csharp
public static readonly CmdError TurningSuppressed

RequestRequiresPlayer 双端 ​

csharp
public static readonly CmdError RequestRequiresPlayer

FailedToAddBuff 双端 ​

csharp
public static readonly CmdError FailedToAddBuff

Happened when the buff is not able to be added.

UnableToAddBuff 双端 ​

csharp
public static readonly CmdError UnableToAddBuff

Happened when the target is not able to add any buff, for example, the target cannot have BuffManager.

ExecutionFailed 双端 ​

csharp
public static readonly CmdError ExecutionFailed

Reward execution failed due to an unexpected error.

MaxRewardTimesReached 双端 ​

csharp
public static readonly CmdError MaxRewardTimesReached

Maximum reward times reached for this user.

BuffStackLimitReached 双端 ​

csharp
public static readonly CmdError BuffStackLimitReached

Buff stack limit reached, cannot add more stacks.

AbilityLevelLimitReached 双端 ​

csharp
public static readonly CmdError AbilityLevelLimitReached

Ability level limit reached, cannot upgrade further.

InvalidQuestData 双端 ​

csharp
public static readonly CmdError InvalidQuestData

Quest data is invalid or null.

QuestNotFound 双端 ​

csharp
public static readonly CmdError QuestNotFound

Quest not found for the player.

PrerequisitesNotMet 双端 ​

csharp
public static readonly CmdError PrerequisitesNotMet

Quest prerequisites not met.

InvalidState 双端 ​

csharp
public static readonly CmdError InvalidState

Invalid quest state for the requested operation.

ServerOnly 双端 ​

csharp
public static readonly CmdError ServerOnly

Operation can only be performed on server.

InvalidCreateMissileData 双端 ​

csharp
public static readonly CmdError InvalidCreateMissileData

CreateMissile mode requires valid missile unit data.

CmdResult 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct CmdResult<T> where T : notnull

Represents the result of a command execution that returns a value, combining success/failure with the result data.

备注

This generic struct extends the command result system to include return values for successful operations. It provides type-safe access to both the result value and error information, with compile-time guarantees about when each property is available.

构造函数 ​

CmdResult 双端 ​

csharp
public CmdResult(T value)

Initializes a new instance of CmdResult1` with a successful result and value.

  • value — The value returned by the successful command execution.
备注

This constructor creates a successful command result containing the specified value.

CmdResult 双端 ​

csharp
public CmdResult(CmdError error)

Initializes a new instance of CmdResult1` with a failed result and error information.

  • error — The error information for the failed command execution.
备注

This constructor creates a failed command result with no value and the specified error.

属性 ​

Value 双端 ​

csharp
public T? Value { get; }

Gets the value returned by the successful command execution, or null if the command failed.

备注

This property is only non-null when IsSuccess is true. The compiler enforces this relationship through nullable reference type annotations.

Result 双端 ​

csharp
public CmdResult Result { get; }

Gets the underlying command result indicating success or failure.

备注

This property provides access to the base command result information, including error details when the command fails.

Error 双端 ​

csharp
public CmdError? Error { get; }

Gets the error information if the command failed, or null if successful.

备注

This property delegates to the underlying Result to provide consistent error access across both generic and non-generic result types.

IsSuccess 双端 ​

csharp
public bool IsSuccess { get; }

Gets a value indicating whether the command executed successfully and returned a value.

备注

When this property is true, the Value property is guaranteed to be non-null. When false, the Error property will contain error information.

方法 ​

implicit operator 双端 ​

csharp
public static CmdResult<T> implicit operator(T value)

Implicitly converts a value to a successful CmdResult1`.

  • value — The value to wrap in a successful result.

返回: A successful command result containing the specified value.

备注

This operator provides convenient creation of successful results from values.

implicit operator 双端 ​

csharp
public static CmdResult implicit operator(CmdResult<T> cmdResult)

Implicitly converts a CmdResult1to a non-genericCmdResult`.

  • cmdResult — The generic command result to convert.

返回: The underlying command result without the value information.

备注

This operator allows generic command results to be used where non-generic results are expected.

implicit operator 双端 ​

csharp
public static CmdResult<T> implicit operator(CmdError error)

Implicitly converts a CmdError to a failed CmdResult1`.

  • error — The error to wrap in a failed result.

返回: A failed command result containing the specified error.

备注

This operator provides convenient creation of failed results from error values.

operator true 双端 ​

csharp
public static bool operator true(CmdResult<T> x)

Enables the use of CmdResult1in boolean contexts, returningtrue` for success.

  • x — The command result to evaluate.

返回: true if the command was successful; otherwise, false.

备注

This operator allows CmdResult1` to be used directly in if statements and other boolean contexts.

operator false 双端 ​

csharp
public static bool operator false(CmdResult<T> x)

Enables the use of CmdResult1in boolean contexts, returningfalse` for success.

  • x — The command result to evaluate.

返回: false if the command was successful; otherwise, true.

备注

This operator is the complement of the true operator and is required for boolean logic operations.

operator ! 双端 ​

csharp
public static bool operator !(CmdResult<T> x)

Negates the success state of the command result.

  • x — The command result to negate.

返回: true if the command failed; false if it succeeded.

备注

This operator allows for negation of the success state, useful for checking failure conditions.

operator & 双端 ​

csharp
public static CmdResult<T> operator &(CmdResult<T> x, CmdResult<T> y)

Performs a logical AND operation on two command results, returning the more severe error.

  • x — The first command result.
  • y — The second command result.

返回: The command result with the higher error severity, or the first successful result if both succeed.

备注

This operator combines two generic command results, preserving values when possible and selecting the more severe error when both fail.

ToString 双端 ​

csharp
public override string? ToString()

Returns a string representation of the command result.

返回: A string containing either the value (for success) or the error information (for failure).

备注

This method provides a human-readable representation of the command result, showing either the contained value or the error details.

ComponentTag 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct ComponentTag : IGameClass, IExtendableEnum<ComponentTag>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

属性 ​

TagMap 双端 ​

csharp
public static TypeMap<ComponentTag> TagMap { get; }

Services 双端 ​

csharp
public static ContentTypeServices<Entity> Services { get; }

方法 ​

CreateComponent 双端 ​

csharp
public static TComponent CreateComponent<TComponent>(Entity host)

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(ComponentTag left, ComponentTag right)

operator != 双端 ​

csharp
public static bool operator !=(ComponentTag left, ComponentTag right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

OrderQueue 双端 ​

csharp
public static readonly ComponentTag OrderQueue

Walkable 双端 ​

csharp
public static readonly ComponentTag Walkable

Turnable 双端 ​

csharp
public static readonly ComponentTag Turnable

UnitPropertyComplex 双端 ​

csharp
public static readonly ComponentTag UnitPropertyComplex

UnitLeveling 双端 ​

csharp
public static readonly ComponentTag UnitLeveling

UnitVision 双端 ​

csharp
public static readonly ComponentTag UnitVision

AIThinkTree 双端 ​

csharp
public static readonly ComponentTag AIThinkTree

Item 双端 ​

csharp
public static readonly ComponentTag Item

ComponentTagEx 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct ComponentTagEx : IGameClass, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(ComponentTagEx left, ComponentTagEx right)

operator != 双端 ​

csharp
public static bool operator !=(ComponentTagEx left, ComponentTagEx right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

implicit operator 双端 ​

csharp
public static ComponentTag implicit operator(ComponentTagEx e)

字段 ​

AbilityManager 双端 ​

csharp
public static readonly ComponentTagEx AbilityManager

BuffManager 双端 ​

csharp
public static readonly ComponentTagEx BuffManager

ResponseManager 双端 ​

csharp
public static readonly ComponentTagEx ResponseManager

InventoryManager 双端 ​

csharp
public static readonly ComponentTagEx InventoryManager

UnitMovementController 双端 ​

csharp
public static readonly ComponentTagEx UnitMovementController

UnitLocomotionAnimation 双端 ​

csharp
public static readonly ComponentTagEx UnitLocomotionAnimation

ContentTypeServices 双端 ​

命名空间 GameCore.BaseType

csharp
public class ContentTypeServices<TContext>

构造函数 ​

ContentTypeServices 双端 ​

csharp
public ContentTypeServices()

方法 ​

Add 双端 ​

csharp
public void Add<TRequest, TService>() where TRequest : class where TService : TRequest, IContextTypeService<TContext, TRequest>

Set 双端 ​

csharp
public void Set<TRequest, TService>() where TRequest : class where TService : TRequest, IContextTypeService<TContext, TRequest>

CreateInstance 双端 ​

csharp
public TRequest CreateInstance<TRequest>(TContext host)

CooldownType 双端 ​

命名空间 GameCore.BaseType

csharp
public enum CooldownType

枚举值 ​

  • Cooldown
  • Charge

DeathType 双端 ​

命名空间 GameCore.BaseType

csharp
public enum DeathType

Defines the different types of death or destruction that can occur to game entities.

备注

This enum categorizes how entities die or are removed from the game, which can affect visual effects, sound effects, revival possibilities, and other game mechanics. Different death types may trigger different behaviors or restrictions.

枚举值 ​

  • Normal — Standard death through normal game mechanics such as health reaching zero.
  • Destroy — Complete destruction that removes the entity entirely from the game.
  • Impact — Death caused by high-impact forces or collision-based damage.
  • Nullified — Death caused by nullification, dispelling, or reality-warping effects.

DisposableObject 双端 ​

命名空间 GameCore.BaseType

csharp
public abstract class DisposableObject : IDisposable

可释放对象基类,实现标准的 Dispose 模式。

备注

派生类应重写以下方法: DisposeManaged - 释放托管资源(如其他 IDisposable 对象) Boolean) - 释放非托管资源(如原生句柄)

构造函数 ​

DisposableObject 双端 ​

csharp
protected DisposableObject()

属性 ​

IsValid 双端 ​

csharp
public virtual bool IsValid { get; }

获取此对象是否有效(未释放且未正在释放)。

IsDisposed 双端 ​

csharp
public bool IsDisposed { get; }

获取此对象是否已释放或正在释放。

方法 ​

Destroy 双端 ​

csharp
public void Destroy()

销毁此对象并释放托管与非托管资源。

备注

对象永久不再使用时应调用此方法,而不是只从所属容器或父级关系中移除。 派生类通常会在释放过程中注销事件、销毁子对象、释放原生句柄或从内部索引表中移除自身。 普通游戏逻辑应使用此无参版本。宿主对象级联释放子对象时,由框架内部调用 DestroyFromHost。

Destroy 双端 ​

csharp
public void Destroy(bool isHostDispose)

销毁此对象并释放资源。

  • isHostDispose — 是否由宿主对象发起的释放。仅供兼容旧调用和框架内部生命周期适配使用。
备注

此重载保留用于兼容已经编译的旧程序集;新代码不应直接传入宿主销毁标记。 当 为 true 时,表示宿主正在级联销毁,派生类可以跳过会触碰宿主或底层场景的重复清理。 传入 true 时,它等价于调用 DestroyFromHost,并会将 hostDisposedValue 设置为 true。 普通业务代码请使用无参 Destroy;框架内部宿主销毁请使用 DestroyFromHost。

DestroyFromHost 双端 ​

csharp
protected internal void DestroyFromHost()

在宿主对象正在销毁时,释放此对象自身的托管资源,并跳过由宿主统一负责的重复非托管清理。

备注

这是宿主级生命周期入口,不是普通业务逻辑的销毁入口;框架内部以及确认宿主正在级联销毁的自定义派生类可以调用它。 典型场景是整个 Scene 卸载:底层场景会统一销毁实体对应的非托管对象,子对象不应再次从场景中移除或重复释放底层句柄。 调用此方法会先将 hostDisposedValue 设置为 true,再进入正常的 Dispose 流程。自定义派生类可以在 DisposeManaged 或 DisposeUnmanaged 中读取此标记,以跳过宿主已经负责的清理,或执行专门的宿主销毁逻辑。

Dispose 双端 ​

csharp
protected virtual void Dispose(bool disposing)

释放资源的核心实现。

  • disposing — 如果为 true,表示由 Dispose() 调用,应释放托管和非托管资源; 如果为 false,表示由终结器调用,只释放非托管资源。

DisposeManaged 双端 ​

csharp
protected virtual void DisposeManaged()

释放托管资源。派生类应重写此方法以释放托管资源。

DisposeUnmanaged 双端 ​

csharp
protected virtual void DisposeUnmanaged(bool finalizing)

释放非托管资源。派生类应重写此方法以释放非托管资源。

  • finalizing — 如果为 true,表示从终结器调用;如果为 false,表示从 Dispose() 调用。

ThrowIfDisposed 双端 ​

csharp
protected void ThrowIfDisposed()

如果对象已释放,则抛出 ObjectDisposedException。

Dispose 双端 ​

csharp
public void Dispose()

字段 ​

hostDisposedValue 双端 ​

csharp
protected bool hostDisposedValue

标识是否由宿主对象发起的释放。

Fraction 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct Fraction

Represents a fractional value in the range [0.0, 1.0].

备注

The Fraction struct is designed to encapsulate a fractional value that is always constrained to the range [0.0, 1.0]. Any attempt to create a Fraction with a value outside this range will result in a debug assertion failure in debug builds.

构造函数 ​

Fraction 双端 ​

csharp
public Fraction(double n)

属性 ​

Value 双端 ​

csharp
public double Value { get; }

方法 ​

implicit operator 双端 ​

csharp
public static Fraction implicit operator(double n)

operator * 双端 ​

csharp
public static Fraction operator *(Fraction a, Fraction b)

operator * 双端 ​

csharp
public static double operator *(Fraction a, double b)

operator * 双端 ​

csharp
public static double operator *(double a, Fraction b)

FuncAngle 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncAngle

FuncAngleEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncAngleEffect

FuncBool 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncBool

FuncBoolEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncBoolEffect

FuncFloat 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncFloat

FuncFloatEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncFloatEffect

FuncInt 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncInt

FuncIntEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncIntEffect

FuncNumber 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncNumber

FuncNumberEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncNumberEffect

FuncNumberExtension 双端 ​

命名空间 GameCore.BaseType

csharp
public static class FuncNumberExtension

方法 ​

AsFuncNumber 双端 ​

csharp
public static FuncNumber AsFuncNumber(this FuncNumberEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncFloat AsFuncNumber(this FuncFloatEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncBool AsFuncNumber(this FuncBoolEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncInt AsFuncNumber(this FuncIntEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncUInt AsFuncNumber(this FuncUIntEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncProbability AsFuncNumber(this FuncProbabilityEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncTime AsFuncNumber(this FuncTimeEffect funcEffectNumber)

AsFuncNumber 双端 ​

csharp
public static FuncRate AsFuncNumber(this FuncRateEffect funcEffectNumber)

FuncProbability 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncProbability

FuncProbabilityEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncProbabilityEffect

FuncRate 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncRate

FuncRateEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncRateEffect

FuncString 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncString

FuncStringEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncStringEffect

FuncTime 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncTime

FuncTimeEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncTimeEffect

FuncUInt 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncUInt

FuncUIntEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate FuncUIntEffect

GameRate 双端 ​

命名空间 GameCore.BaseType

csharp
public struct GameRate : IComparable<GameRate>, IEquatable<GameRate>, IComparable<float>, IEquatable<float>

构造函数 ​

GameRate 双端 ​

csharp
public GameRate(float value)

属性 ​

RatePerTick 双端 ​

csharp
public float RatePerTick { get; set; }

RatePerSecond 双端 ​

csharp
public float RatePerSecond { get; set; }

方法 ​

implicit operator 双端 ​

csharp
public static GameRate implicit operator(float value)

explicit operator 双端 ​

csharp
public static float explicit operator(GameRate value)

operator + 双端 ​

csharp
public static GameRate operator +(GameRate left, GameRate right)

operator - 双端 ​

csharp
public static GameRate operator -(GameRate left, GameRate right)

operator * 双端 ​

csharp
public static GameRate operator *(GameRate left, GameRate right)

operator / 双端 ​

csharp
public static GameRate operator /(GameRate left, GameRate right)

operator + 双端 ​

csharp
public static GameRate operator +(GameRate left, float right)

operator - 双端 ​

csharp
public static GameRate operator -(GameRate left, float right)

operator * 双端 ​

csharp
public static GameRate operator *(GameRate left, float right)

operator / 双端 ​

csharp
public static GameRate operator /(GameRate left, float right)

ToString 双端 ​

csharp
public override readonly string? ToString()

GetTime 双端 ​

csharp
public readonly TimeSpan GetTime(float delta)

CompareTo 双端 ​

csharp
public readonly int CompareTo(GameRate other)

Equals 双端 ​

csharp
public readonly bool Equals(GameRate other)

CompareTo 双端 ​

csharp
public readonly int CompareTo(float other)

Equals 双端 ​

csharp
public readonly bool Equals(float other)

Equals 双端 ​

csharp
public override readonly bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override readonly int GetHashCode()

operator == 双端 ​

csharp
public static bool operator ==(GameRate left, GameRate right)

operator != 双端 ​

csharp
public static bool operator !=(GameRate left, GameRate right)

operator < 双端 ​

csharp
public static bool operator <(GameRate left, GameRate right)

operator <= 双端 ​

csharp
public static bool operator <=(GameRate left, GameRate right)

operator > 双端 ​

csharp
public static bool operator >(GameRate left, GameRate right)

operator >= 双端 ​

csharp
public static bool operator >=(GameRate left, GameRate right)

字段 ​

Zero 双端 ​

csharp
public static readonly GameRate Zero

IResponseOwner 双端 ​

命名空间 GameCore.BaseType

csharp
public interface IResponseOwner : IExecutionContext

属性 ​

Host 双端 ​

csharp
public Unit Host { get; }

Cache 双端 ​

csharp
public IResponseOwnerData Cache { get; }

Responses 双端 ​

csharp
public HashSet<Response>? Responses { get; set; }

IsActivated 双端 ​

csharp
public bool IsActivated { get; }

方法 ​

InitResponses 双端 ​

csharp
void InitResponses()

AddResponse 双端 ​

csharp
void AddResponse(IGameLink<GameDataResponse> responseLink)

RemoveResponse 双端 ​

csharp
void RemoveResponse(Response response, bool destroy = false)

DisposeResponses 双端 ​

csharp
void DisposeResponses()

IResponseOwnerExtensions 双端 ​

命名空间 GameCore.BaseType

csharp
public static class IResponseOwnerExtensions

方法 ​

InitResponses 双端 ​

csharp
public static void InitResponses(this IResponseOwner owner)

AddResponse 双端 ​

csharp
public static void AddResponse(this IResponseOwner owner, IGameLink<GameDataResponse> responseLink)

RemoveResponse 双端 ​

csharp
public static void RemoveResponse(this IResponseOwner owner, Response response, bool destroy = false)

DisposeResponses 双端 ​

csharp
public static void DisposeResponses(this IResponseOwner owner)

ISyncIdOwner 双端 ​

命名空间 GameCore.BaseType

csharp
public interface ISyncIdOwner

属性 ​

SyncId 双端 ​

csharp
public int SyncId { get; }

SyncIdShifted 双端 ​

csharp
public long SyncIdShifted { get; }

方法 ​

ResolvePropertyHash 双端 ​

csharp
static (int attachedSyncId, int propertyHash) ResolvePropertyHash(long propertyHashLong)

LocVarType 双端 ​

命名空间 GameCore.BaseType

csharp
public enum LocVarType

枚举值 ​

  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H

LoggerTextWriter 双端 ​

命名空间 GameCore.BaseType

csharp
public class LoggerTextWriter : TextWriter

构造函数 ​

LoggerTextWriter 双端 ​

csharp
public LoggerTextWriter(ILogger logger, LogLevel level)

属性 ​

Encoding 双端 ​

csharp
public override Encoding Encoding { get; }

方法 ​

Write 双端 ​

csharp
public override void Write(char value)

Write 双端 ​

csharp
public override void Write(string? value)

Write 双端 ​

csharp
public override void Write(char[]? buffer)

Write 双端 ​

csharp
public override void Write(char[] buffer, int index, int count)

Write 双端 ​

csharp
public override void Write(ReadOnlySpan<char> buffer)

WriteLine 双端 ​

csharp
public override void WriteLine(string? value)

WriteLine 双端 ​

csharp
public override void WriteLine()

WriteLine 双端 ​

csharp
public override void WriteLine(bool value)

WriteLine 双端 ​

csharp
public override void WriteLine(char value)

WriteLine 双端 ​

csharp
public override void WriteLine(char[]? buffer)

WriteLine 双端 ​

csharp
public override void WriteLine(char[] buffer, int index, int count)

WriteLine 双端 ​

csharp
public override void WriteLine(decimal value)

WriteLine 双端 ​

csharp
public override void WriteLine(double value)

WriteLine 双端 ​

csharp
public override void WriteLine(int value)

WriteLine 双端 ​

csharp
public override void WriteLine(long value)

WriteLine 双端 ​

csharp
public override void WriteLine(object? value)

WriteLine 双端 ​

csharp
public override void WriteLine(ReadOnlySpan<char> buffer)

WriteLine 双端 ​

csharp
public override void WriteLine(float value)

WriteLine 双端 ​

csharp
public override void WriteLine(string format, object? arg0)

WriteLine 双端 ​

csharp
public override void WriteLine(string format, object? arg0, object? arg1)

WriteLine 双端 ​

csharp
public override void WriteLine(string format, object? arg0, object? arg1, object? arg2)

WriteLine 双端 ​

csharp
public override void WriteLine(string format, params object?[] arg)

WriteLine 双端 ​

csharp
public override void WriteLine(string format, params ReadOnlySpan<object?> arg)

WriteLine 双端 ​

csharp
public override void WriteLine(StringBuilder? value)

WriteLine 双端 ​

csharp
public override void WriteLine(uint value)

WriteLine 双端 ​

csharp
public override void WriteLine(ulong value)

Flush 双端 ​

csharp
public override void Flush()

Dispose 双端 ​

csharp
protected override void Dispose(bool disposing)

Probability 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct Probability

Represents a probability value in the range [0.0, 1.0].

备注

The Probability struct is designed to encapsulate a probability value, ensuring it remains within the valid range of 0.0 to 1.0. It provides methods and operators for arithmetic operations, random generation, and conversions to and from other numeric types. This type is immutable. It is suitable for use in scenarios requiring high-precision probability calculations, such as simulations or statistical modeling. 精确到小数点后28位。

构造函数 ​

Probability 双端 ​

csharp
public Probability(decimal n)

Probability 双端 ​

csharp
public Probability(double n)

属性 ​

Value 双端 ​

csharp
public decimal Value { get; }

方法 ​

Pass 双端 ​

csharp
public bool Pass()

NextRandom 双端 ​

csharp
public static Probability NextRandom()

Generates a new random probability value.

返回: A Probability instance representing a random value between 0 and 1, inclusive.

备注

The generated probability is created using a high-precision random number generator. This method is suitable for scenarios requiring precise random values within the range of probabilities.

ToDouble 双端 ​

csharp
public double ToDouble()

implicit operator 双端 ​

csharp
public static Probability implicit operator(decimal n)

implicit operator 双端 ​

csharp
public static Probability implicit operator(double n)

implicit operator 双端 ​

csharp
public static Probability implicit operator(int n)

explicit operator 双端 ​

csharp
public static decimal explicit operator(Probability p)

ToString 双端 ​

csharp
public override string ToString()

ToString 双端 ​

csharp
public string ToString(string format)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

operator == 双端 ​

csharp
public static bool operator ==(Probability left, Probability right)

operator != 双端 ​

csharp
public static bool operator !=(Probability left, Probability right)

operator < 双端 ​

csharp
public static bool operator <(Probability left, Probability right)

operator > 双端 ​

csharp
public static bool operator >(Probability left, Probability right)

operator <= 双端 ​

csharp
public static bool operator <=(Probability left, Probability right)

operator >= 双端 ​

csharp
public static bool operator >=(Probability left, Probability right)

operator + 双端 ​

csharp
public static Probability operator +(Probability left, Probability right)

operator - 双端 ​

csharp
public static Probability operator -(Probability left, Probability right)

operator * 双端 ​

csharp
public static Probability operator *(Probability left, Probability right)

operator * 双端 ​

csharp
public static Probability operator *(Probability probability, decimal multiplier)

operator * 双端 ​

csharp
public static Probability operator *(decimal multiplier, Probability probability)

PropertyAttachedObject 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct PropertyAttachedObject : IGameClass, IExtendableEnum<PropertyAttachedObject>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(PropertyAttachedObject left, PropertyAttachedObject right)

operator != 双端 ​

csharp
public static bool operator !=(PropertyAttachedObject left, PropertyAttachedObject right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

TypeHash 双端 ​

csharp
public static readonly PropertyAttachedObject TypeHash
csharp
public static readonly PropertyAttachedObject Link

OwnerSyncId 双端 ​

csharp
public static readonly PropertyAttachedObject OwnerSyncId

ContextSyncId 双端 ​

csharp
public static readonly PropertyAttachedObject ContextSyncId

ModSeed 双端 ​

csharp
public static readonly PropertyAttachedObject ModSeed

CreationIndex 双端 ​

csharp
public static readonly PropertyAttachedObject CreationIndex

PropertySubType 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct PropertySubType : IGameClass, IExtendableEnum<PropertySubType>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(PropertySubType left, PropertySubType right)

operator != 双端 ​

csharp
public static bool operator !=(PropertySubType left, PropertySubType right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

Base 双端 ​

csharp
public static readonly PropertySubType Base

PropertyVital 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct PropertyVital : IExtendableEnum<PropertyVital>, IExtendableEnum, IExtendedEnum, ISyncIdOwner, IGameClass

方法 ​

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(PropertyVital left, PropertyVital right)

operator != 双端 ​

csharp
public static bool operator !=(PropertyVital left, PropertyVital right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

implicit operator 双端 ​

csharp
public static ComponentTag implicit operator(PropertyVital e)

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

Health 双端 ​

csharp
public static readonly PropertyVital Health

Mana 双端 ​

csharp
public static readonly PropertyVital Mana

ReplicateDiagnosticReason 双端 ​

命名空间 GameCore.BaseType

csharp
public enum ReplicateDiagnosticReason

枚举值 ​

  • EngineMetadataSkipped
  • HostMissing
  • ComponentMissing
  • LinkNotVisible
  • NonzeroLinkDataMissing
  • UnknownPropertyKey

ReplicateDiagnostics 双端 ​

命名空间 GameCore.BaseType

csharp
public static class ReplicateDiagnostics

属性 ​

Enabled 双端 ​

csharp
public static bool Enabled { get; set; }

方法 ​

Record 双端 ​

csharp
public static void Record(ReplicateDiagnosticReason reason)

GetCount 双端 ​

csharp
public static long GetCount(ReplicateDiagnosticReason reason)

Snapshot 双端 ​

csharp
public static IReadOnlyDictionary<ReplicateDiagnosticReason, long> Snapshot(bool reset = false)

Reset 双端 ​

csharp
public static void Reset()

FormatSummary 双端 ​

csharp
public static string FormatSummary(IReadOnlyDictionary<ReplicateDiagnosticReason, long> snapshot)

LogSummary 双端 ​

csharp
public static void LogSummary(ILogger? logger = null, bool reset = true)

ReplicatePropertyKey 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct ReplicatePropertyKey : IEquatable<ReplicatePropertyKey>

构造函数 ​

ReplicatePropertyKey 双端 ​

csharp
public ReplicatePropertyKey(ReplicatePropertyKeyKind Kind, int OwnerId, int PropertyHash)

属性 ​

Kind 双端 ​

csharp
public ReplicatePropertyKeyKind Kind { get; init; }

OwnerId 双端 ​

csharp
public int OwnerId { get; init; }

PropertyHash 双端 ​

csharp
public int PropertyHash { get; init; }

IsProperty 双端 ​

csharp
public bool IsProperty { get; }

IsHostProperty 双端 ​

csharp
public bool IsHostProperty { get; }

IsComponentProperty 双端 ​

csharp
public bool IsComponentProperty { get; }

方法 ​

From 双端 ​

csharp
public static ReplicatePropertyKey From(long key)

ToString 双端 ​

csharp
public override string ToString()

operator != 双端 ​

csharp
public static bool operator !=(ReplicatePropertyKey left, ReplicatePropertyKey right)

operator == 双端 ​

csharp
public static bool operator ==(ReplicatePropertyKey left, ReplicatePropertyKey right)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object obj)

Equals 双端 ​

csharp
public bool Equals(ReplicatePropertyKey other)

Deconstruct 双端 ​

csharp
public void Deconstruct(out ReplicatePropertyKeyKind Kind, out int OwnerId, out int PropertyHash)

ReplicatePropertyKeyKind 双端 ​

命名空间 GameCore.BaseType

csharp
public enum ReplicatePropertyKeyKind

枚举值 ​

  • HostProperty
  • ComponentProperty
  • EngineMetadata

RuntimeLogger 双端 ​

命名空间 GameCore.BaseType

csharp
public sealed class RuntimeLogger : ILogger

构造函数 ​

RuntimeLogger 双端 ​

csharp
public RuntimeLogger(ILogger innerLogger)

属性 ​

MinimumLevel 双端 ​

csharp
public LogLevel MinimumLevel { get; set; }

InnerLogger 双端 ​

csharp
public ILogger InnerLogger { get; }

方法 ​

BeginScope 双端 ​

csharp
public IDisposable? BeginScope<TState>(TState state) where TState : notnull

IsEnabled 双端 ​

csharp
public bool IsEnabled(LogLevel logLevel)

Log 双端 ​

csharp
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)

SnowflakeIdGenerator 双端 ​

命名空间 GameCore.BaseType

csharp
public class SnowflakeIdGenerator

构造函数 ​

SnowflakeIdGenerator 双端 ​

csharp
public SnowflakeIdGenerator(int sectionSeed)

SnowflakeIdGenerator 双端 ​

csharp
public SnowflakeIdGenerator(long section)

方法 ​

NextId 双端 ​

csharp
public long NextId()

字段 ​

MaxMachineId 双端 ​

csharp
public const long MaxMachineId

StateCounter 双端 ​

命名空间 GameCore.BaseType

csharp
public class StateCounter<T> where T : notnull

构造函数 ​

StateCounter 双端 ​

csharp
public StateCounter()

方法 ​

Add 双端 ​

csharp
public void Add(T state, int count = 1)

AddImmunity 双端 ​

csharp
public void AddImmunity(T state, int countImmunity = 1)

GetEnabledStates 双端 ​

csharp
public HashSet<T> GetEnabledStates()

HasState 双端 ​

csharp
public bool HasState(T state)

Count 双端 ​

csharp
public int Count(T state)

CountImmunity 双端 ​

csharp
public int CountImmunity(T state)

ToString 双端 ​

csharp
public override string? ToString()

事件 ​

OnStateChange 双端 ​

csharp
public event Action<T>? OnStateChange

StructRange 双端 ​

命名空间 GameCore.BaseType

csharp
public struct StructRange<T> where T : struct

构造函数 ​

StructRange 双端 ​

csharp
public StructRange(T min, T max)

属性 ​

Min 双端 ​

csharp
public T Min { get; set; }

Max 双端 ​

csharp
public T Max { get; set; }

SyncIdRules 双端 ​

命名空间 GameCore.BaseType

csharp
public static class SyncIdRules

方法 ​

IsReservedComponentSyncId 双端 ​

csharp
public static bool IsReservedComponentSyncId(int syncId)

字段 ​

HostPropertyOwnerId 双端 ​

csharp
public const int HostPropertyOwnerId

EngineMetadataOwnerId 双端 ​

csharp
public const int EngineMetadataOwnerId

SyncIdType 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct SyncIdType : IGameClass, IExtendableEnum<SyncIdType>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(SyncIdType left, SyncIdType right)

operator != 双端 ​

csharp
public static bool operator !=(SyncIdType left, SyncIdType right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

Entity 双端 ​

csharp
public static readonly SyncIdType Entity

Actor 双端 ​

csharp
public static readonly SyncIdType Actor

ActorScope 双端 ​

csharp
public static readonly SyncIdType ActorScope

Ability 双端 ​

csharp
public static readonly SyncIdType Ability

Buff 双端 ​

csharp
public static readonly SyncIdType Buff

Component 双端 ​

csharp
public static readonly SyncIdType Component

Player 双端 ​

csharp
public static readonly SyncIdType Player

Game 双端 ​

csharp
public static readonly SyncIdType Game

Scene 双端 ​

csharp
public static readonly SyncIdType Scene

PropertyObject 双端 ​

csharp
public static readonly SyncIdType PropertyObject

TargetLocation 双端 ​

命名空间 GameCore.BaseType

csharp
public enum TargetLocation

枚举值 ​

  • Default
  • Caster
  • Target
  • MainTarget
  • Missile
  • Source
  • UnitLocalVar
  • PointLocalVar

TargetType 双端 ​

命名空间 GameCore.BaseType

csharp
public enum TargetType

定义效果节点的目标类型,决定效果创建后的位置类型和表现行为。

备注

TargetType 属性是效果系统的核心配置之一,它不仅决定了效果节点如何解析目标, 更重要的是影响了效果节点的视觉表现(Actor)的播放位置和跟随行为。 🎯 目标解析规则: Any:接受目标的天然类型,不进行类型转换 Unit:强制转换为单位目标,如果目标是点则会令整个效果执行失败 Point:强制转换为点目标,提取目标的坐标位置作为效果的执行目标 🎭 表现播放影响: 持续性效果:如果 TargetType 为 Unit,表现会在生存周期内跟随目标单位移动 瞬间效果:虽然效果本身瞬间生效,但附带的表现仍受 TargetType 影响 AOE 搜索效果:即使搜索结果相同,表现的播放位置也会根据 TargetType 而不同 💡 示例:以单位为中心的 AOE 伤害效果,如果 TargetType 设为 Unit,爆炸特效会跟随单位移动直到播放结束; 如果设为 Point,特效会停留在单位施法瞬间的地点播放。 ⚠️ 语义限制: 某些效果类型由于业务语义限制,天然只能对单位实体生效,不应将 TargetType 设置为 Point: 伤害效果(GameDataEffectDamage):只能对单位造成伤害 Buff效果(GameDataEffectBuffAdd/Remove):只能为单位添加/移除状态 移动器效果(GameDataEffectUnitMoverApply/Remove):只能修改单位的移动行为 单位属性修改(GameDataEffectUnitModifyVital/Facing/Owner):只能修改单位属性 技能修改效果(GameDataEffectAbilityModify系列):只能修改单位的技能 这些效果通常继承自 GameDataEffectUnit 基类,其默认 TargetType 为 Unit。 手动设置为 Point 会导致整个效果执行失败,因为点目标无法满足效果的业务语义要求。

枚举值 ​

  • Any — 接受任何有效的目标类型,保持目标的天然类型不变。
  • Unit — 目标必须是单位实体(玩家、NPC、生物或其他可交互对象)。
  • Point — 目标必须是场景中的特定点或位置坐标。

UnitFilter 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct UnitFilter : IGameClass, IExtendableEnum<UnitFilter>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(UnitFilter left, UnitFilter right)

operator != 双端 ​

csharp
public static bool operator !=(UnitFilter left, UnitFilter right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

implicit operator 双端 ​

csharp
public static UnitFilterTag implicit operator(UnitFilter e)

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

Unit 双端 ​

csharp
public static readonly UnitFilter Unit

Missile 双端 ​

csharp
public static readonly UnitFilter Missile

Hero 双端 ​

csharp
public static readonly UnitFilter Hero

Ground 双端 ​

csharp
public static readonly UnitFilter Ground

Air 双端 ​

csharp
public static readonly UnitFilter Air

Structure 双端 ​

csharp
public static readonly UnitFilter Structure

Item 双端 ​

csharp
public static readonly UnitFilter Item

UnitFilterTag 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct UnitFilterTag : IGameClass, IExtendableEnum<UnitFilterTag>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(UnitFilterTag left, UnitFilterTag right)

operator != 双端 ​

csharp
public static bool operator !=(UnitFilterTag left, UnitFilterTag right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

UnitRelationship 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct UnitRelationship : IGameClass, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(UnitRelationship left, UnitRelationship right)

operator != 双端 ​

csharp
public static bool operator !=(UnitRelationship left, UnitRelationship right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

implicit operator 双端 ​

csharp
public static UnitFilterTag implicit operator(UnitRelationship e)

字段 ​

Self 双端 ​

csharp
public static readonly UnitRelationship Self

Player 双端 ​

csharp
public static readonly UnitRelationship Player

Alliance 双端 ​

csharp
public static readonly UnitRelationship Alliance

Neutral 双端 ​

csharp
public static readonly UnitRelationship Neutral

Enemy 双端 ​

csharp
public static readonly UnitRelationship Enemy

Visible 双端 ​

csharp
public static readonly UnitRelationship Visible

UnitState 双端 ​

命名空间 GameCore.BaseType

csharp
public readonly struct UnitState : IGameClass, IExtendableEnum<UnitState>, IExtendableEnum, IExtendedEnum, ISyncIdOwner

方法 ​

ToString 双端 ​

csharp
public override string? ToString()

operator == 双端 ​

csharp
public static bool operator ==(UnitState left, UnitState right)

operator != 双端 ​

csharp
public static bool operator !=(UnitState left, UnitState right)

Equals 双端 ​

csharp
public override bool Equals(object? obj)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

OnRegisterGameClass 双端 ​

csharp
public static void OnRegisterGameClass()

implicit operator 双端 ​

csharp
public static UnitFilterTag implicit operator(UnitState e)

字段 ​

InnerValue 双端 ​

csharp
public readonly Enum InnerValue

Invulnerable 双端 ​

csharp
public static readonly UnitState Invulnerable

无敌

SpellImmunity 双端 ​

csharp
public static readonly UnitState SpellImmunity

魔免

Ethereal 双端 ​

csharp
public static readonly UnitState Ethereal

物免

Unkillable 双端 ​

csharp
public static readonly UnitState Unkillable

免死

Summoned 双端 ​

csharp
public static readonly UnitState Summoned

召唤

UnCommandable 双端 ​

csharp
public static readonly UnitState UnCommandable

无法被玩家或AI命令

Dead 双端 ​

csharp
public static readonly UnitState Dead

死亡

Illusion 双端 ​

csharp
public static readonly UnitState Illusion

幻象

Hidden 双端 ​

csharp
public static readonly UnitState Hidden

隐藏

InvisibleToEnemy 双端 ​

csharp
public static readonly UnitState InvisibleToEnemy

Indicates whether the entity is invisible to enemies. This affects how enemies perceive and interact with the entity.

Detected 双端 ​

csharp
public static readonly UnitState Detected

Revealed to enemy, suppress InvisibleToEnemy

UnobstructedSight 双端 ​

csharp
public static readonly UnitState UnobstructedSight

可理解为空中视野,视野范围为圆形,不会被障碍物阻挡

VectorMove3D 双端 ​

csharp
public static readonly UnitState VectorMove3D

单位可以进行3D摇杆移动,如飞行等等。仅适用于3D模式游戏。

VectorMoveBypassOrderQueue 双端 ​

csharp
public static readonly UnitState VectorMoveBypassOrderQueue

单位可以进行摇杆移动,即使单位正在施法。

IgnoreSelector 双端 ​

csharp
public static readonly UnitState IgnoreSelector

无法被搜索

IgnoreTerrainHeight 双端 ​

csharp
public static readonly UnitState IgnoreTerrainHeight

Indicates whether terrain height should be ignored in calculations. Useful for scenarios where elevation is not a factor.

SuppressActor 双端 ​

csharp
public static readonly UnitState SuppressActor

隐藏表现

SuppressAutoTurningWhenMoving 双端 ​

csharp
public static readonly UnitState SuppressAutoTurningWhenMoving

摇杆移动与寻路时,禁止自动转向。否则会自动面向移动方向。

SuppressDynamicCollision 双端 ​

csharp
public static readonly UnitState SuppressDynamicCollision

忽略动态碰撞

SuppressStaticCollision 双端 ​

csharp
public static readonly UnitState SuppressStaticCollision

忽略静态碰撞

SuppressMovement 双端 ​

csharp
public static readonly UnitState SuppressMovement

Temporarily prevents the unit from walking or pathfinding, such as when stunned or frozen by a buff. Unlike this state suggests that the unit's movement is temporarily suppressed; it still allows the unit to handle approach orders and resume movement. The unit will proceed to moving once the suppression is lifted.

DisableMovement 双端 ​

csharp
public static readonly UnitState DisableMovement

Permanently disables the unit's ability to move, preventing walking, pathfinding, or handling approach orders. Unlike this state indicates indefinite movement restriction; instead of temporarily suppressed, the unit will not be able to handle any approaching orders.

SuppressTurning 双端 ​

csharp
public static readonly UnitState SuppressTurning

Temporarily prevents the unit from turning or facing to an object, such as when stunned or frozen by a buff.

备注

Unlike this state suggests that the unit's turning is temporarily suppressed; it still allows the unit to handle approach orders and resume turning. The unit will proceed to turning once the suppression is lifted.

DisableTurning 双端 ​

csharp
public static readonly UnitState DisableTurning

Disables the ability to turn or face to a direction.

备注

This method prevents any further turning or facing actions on the object. It is typically used to lock the object's orientation in scenarios where facing is not allowed.

Validator 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate Validator

ValidatorEffect 双端 ​

命名空间 GameCore.BaseType

csharp
public delegate ValidatorEffect

ValidatorExtension 双端 ​

命名空间 GameCore.BaseType

csharp
public static class ValidatorExtension

方法 ​

AsValidator 双端 ​

csharp
public static Validator AsValidator(this ValidatorEffect validatorEffect)

PreValidate 双端 ​

csharp
public static CmdResult PreValidate(this ValidatorEffect validatorEffect, Effect effect, Entity target)

Invokes the specified validator effect on the given effect, temporarily setting its target to the provided entity for validation purposes.

  • validatorEffect — A delegate that performs validation on the effect and returns a command result.
  • effect — The effect to be validated. Its target will be temporarily set to the specified entity during validation.
  • target — The entity to assign as the target of the effect during validation.

返回: A CmdResult indicating the outcome of the validation operation.

备注

If the effect is marked as pre-validator only, the target is set and the validator is invoked directly. Otherwise, the original target is preserved and restored after validation. This method is typically used to validate effects against different potential targets without permanently modifying the effect's state.

ValueRange 双端 ​

命名空间 GameCore.BaseType

csharp
public struct ValueRange<T> where T : IComparable<T>

Represents a range of values with minimum and maximum bounds for any comparable type.

备注

This struct automatically handles invalid ranges where min > max by swapping the values and logging a warning. It provides methods to check if a value falls within the defined range.

构造函数 ​

ValueRange 双端 ​

csharp
public ValueRange(T min, T max)

Initializes a new instance of the ValueRange1` struct with the specified minimum and maximum values.

  • min — The minimum value of the range.
  • max — The maximum value of the range.
备注

If is greater than , the values will be swapped and a warning will be logged.

属性 ​

Min 双端 ​

csharp
public T Min { get; set; }

Gets or sets the minimum value of the range.

Max 双端 ​

csharp
public T Max { get; set; }

Gets or sets the maximum value of the range.

方法 ​

IsInRange 双端 ​

csharp
public readonly bool IsInRange(T value)

Determines whether the specified value falls within this range (inclusive of boundaries).

  • value — The value to check.

返回: true if the value is within the range; otherwise, false.