主题
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, IDisposableDirectly 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? OnRemovedOnAttachedObjectStateChanged 双端
csharp
public event Action<AttachedObjectState>? OnAttachedObjectStateChangedOnBecomeDisabled 仅服务端
csharp
public event Action? OnBecomeDisabledOnBecomeEnabled 仅服务端
csharp
public event Action? OnBecomeEnabled字段
OnAttachedObjectStateChangedHandler 双端
csharp
protected Action<AttachedObjectState>? OnAttachedObjectStateChangedHandler_clientActors 仅客户端
csharp
protected HashSet<Actor>? _clientActorsaggregator 双端
csharp
protected EventAggregator? aggregatorStateCounter 仅服务端
csharp
protected StateCounter<AttachedObjectState> StateCounterAttachedObjectState 双端
命名空间 GameCore.BaseType
csharp
public enum AttachedObjectState枚举值
DeactivatedDisabledHidden
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 InnerValueAttachedType 双端
命名空间 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 InnerValueAbility 双端
csharp
public static readonly AttachedType AbilityBuff 双端
csharp
public static readonly AttachedType BuffBehavior 双端
csharp
public static readonly AttachedType BehaviorResponse 双端
csharp
public static readonly AttachedType ResponseModifier 双端
csharp
public static readonly AttachedType ModifierBearingSnapshot 双端
命名空间 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 InnerValueNotSupported 双端
csharp
public static readonly CmdError NotSupportedError 双端
csharp
public static readonly CmdError ErrorAbilityNotFound 双端
csharp
public static readonly CmdError AbilityNotFoundMustTargetUnit 双端
csharp
public static readonly CmdError MustTargetUnitMustTargetEntity 双端
csharp
public static readonly CmdError MustTargetEntityMustTargetItem 双端
csharp
public static readonly CmdError MustTargetItemNotStarted 双端
csharp
public static readonly CmdError NotStartedNoOrderQueue 双端
csharp
public static readonly CmdError NoOrderQueueNoComponentToHandleOrder 双端
csharp
public static readonly CmdError NoComponentToHandleOrderNoValidAttackAbility 双端
csharp
public static readonly CmdError NoValidAttackAbilityNoTriggerAbility 双端
csharp
public static readonly CmdError NoTriggerAbilityNotEnoughTarget 双端
csharp
public static readonly CmdError NotEnoughTargetNotEnoughRoomToPlace 双端
csharp
public static readonly CmdError NotEnoughRoomToPlaceNotEnoughChildrenToExecute 双端
csharp
public static readonly CmdError NotEnoughChildrenToExecuteNothingToExecute 双端
csharp
public static readonly CmdError NothingToExecuteMustTargetCertainUnit 双端
csharp
public static readonly CmdError MustTargetCertainUnitCanOnlyTargetUnitWithInventory 双端
csharp
public static readonly CmdError CanOnlyTargetUnitWithInventoryCannotFindCaster 双端
csharp
public static readonly CmdError CannotFindCasterCannotIssueThatOrder 双端
csharp
public static readonly CmdError CannotIssueThatOrderCannotTargetCertainUnit 双端
csharp
public static readonly CmdError CannotTargetCertainUnitCannotControlThatUnit 双端
csharp
public static readonly CmdError CannotControlThatUnitCannotControlThatAbility 双端
csharp
public static readonly CmdError CannotControlThatAbilityCannotControlThatItem 双端
csharp
public static readonly CmdError CannotControlThatItemCannotControlThatSlot 双端
csharp
public static readonly CmdError CannotControlThatSlotCannotTakeThatItem 双端
csharp
public static readonly CmdError CannotTakeThatItemCannotDropThatItem 双端
csharp
public static readonly CmdError CannotDropThatItemCannotSeeTarget 双端
csharp
public static readonly CmdError CannotSeeTargetCannotMove 双端
csharp
public static readonly CmdError CannotMoveCannotMoveWhileDead 双端
csharp
public static readonly CmdError CannotMoveWhileDeadCannotMoveToTarget 双端
csharp
public static readonly CmdError CannotMoveToTargetCannotTurn 双端
csharp
public static readonly CmdError CannotTurnCannotTurnToTarget 双端
csharp
public static readonly CmdError CannotTurnToTargetCannotTurnWhileDead 双端
csharp
public static readonly CmdError CannotTurnWhileDeadCannotTurnWhenSpeedIsZero 双端
csharp
public static readonly CmdError CannotTurnWhenSpeedIsZeroCannotUseHiddenAbility 双端
csharp
public static readonly CmdError CannotUseHiddenAbilityCannotUseDisabledAbility 双端
csharp
public static readonly CmdError CannotUseDisabledAbilityTargetIsDead 双端
csharp
public static readonly CmdError TargetIsDeadTargetIsRemoved 双端
csharp
public static readonly CmdError TargetIsRemovedTargetIsInAnotherScene 双端
csharp
public static readonly CmdError TargetIsInAnotherSceneTargetSceneIsNotLoaded 双端
csharp
public static readonly CmdError TargetSceneIsNotLoadedTargetIsOutOfRange 双端
csharp
public static readonly CmdError TargetIsOutOfRangeTargetIsTooClose 双端
csharp
public static readonly CmdError TargetIsTooCloseInventoryIsFull 双端
csharp
public static readonly CmdError InventoryIsFullNoIntermediateUnit 双端
csharp
public static readonly CmdError NoIntermediateUnitAlreadyCancelled 双端
csharp
public static readonly CmdError AlreadyCancelledAlreadyIssued 双端
csharp
public static readonly CmdError AlreadyIssuedAlreadyQueued 双端
csharp
public static readonly CmdError AlreadyQueuedAlreadyExecuted 双端
csharp
public static readonly CmdError AlreadyExecutedAlreadyToggled 双端
csharp
public static readonly CmdError AlreadyToggledCasterIsRemoved 双端
csharp
public static readonly CmdError CasterIsRemovedCasterIsDead 双端
csharp
public static readonly CmdError CasterIsDeadCannotTargetThat 双端
csharp
public static readonly CmdError CannotTargetThatCasterCannotUseAbility 双端
csharp
public static readonly CmdError CasterCannotUseAbilityIsInCooldown 双端
csharp
public static readonly CmdError IsInCooldownIsDisabled 双端
csharp
public static readonly CmdError IsDisabledNotEnoughCharges 双端
csharp
public static readonly CmdError NotEnoughChargesNotEnoughResource 双端
csharp
public static readonly CmdError NotEnoughResourceTooMuchResource 双端
csharp
public static readonly CmdError TooMuchResourceCannotPlaceThere 双端
csharp
public static readonly CmdError CannotPlaceThereLaunchSiteUnitIsRemoved 双端
csharp
public static readonly CmdError LaunchSiteUnitIsRemovedInvalidUnitType 双端
csharp
public static readonly CmdError InvalidUnitTypeInvalidPlayer 双端
csharp
public static readonly CmdError InvalidPlayerInvalidAbilityType 双端
csharp
public static readonly CmdError InvalidAbilityTypeInvalidBuffType 双端
csharp
public static readonly CmdError InvalidBuffTypeInvalidCommandData 双端
csharp
public static readonly CmdError InvalidCommandDataInvalidMoverData 双端
csharp
public static readonly CmdError InvalidMoverDataInvalidCountData 双端
csharp
public static readonly CmdError InvalidCountDataInvalidFacingData 双端
csharp
public static readonly CmdError InvalidFacingDataInvalidSetData 双端
csharp
public static readonly CmdError InvalidSetDataInvalidVectorMoveTarget 双端
csharp
public static readonly CmdError InvalidVectorMoveTargetInvalidItemType 双端
csharp
public static readonly CmdError InvalidItemTypeInvalidRange 双端
csharp
public static readonly CmdError InvalidRangeInvalidTarget 双端
csharp
public static readonly CmdError InvalidTargetInvalidMissileUnit 双端
csharp
public static readonly CmdError InvalidMissileUnitInvalidLaunchLocationData 双端
csharp
public static readonly CmdError InvalidLaunchLocationDataInvalidTargetData 双端
csharp
public static readonly CmdError InvalidTargetDataItemIsNotUseable 双端
csharp
public static readonly CmdError ItemIsNotUseableItemDoesNotHaveAbility 双端
csharp
public static readonly CmdError ItemDoesNotHaveAbilityMovementSuppressed 双端
csharp
public static readonly CmdError MovementSuppressedTurningSuppressed 双端
csharp
public static readonly CmdError TurningSuppressedRequestRequiresPlayer 双端
csharp
public static readonly CmdError RequestRequiresPlayerFailedToAddBuff 双端
csharp
public static readonly CmdError FailedToAddBuffHappened when the buff is not able to be added.
UnableToAddBuff 双端
csharp
public static readonly CmdError UnableToAddBuffHappened when the target is not able to add any buff, for example, the target cannot have BuffManager.
ExecutionFailed 双端
csharp
public static readonly CmdError ExecutionFailedReward execution failed due to an unexpected error.
MaxRewardTimesReached 双端
csharp
public static readonly CmdError MaxRewardTimesReachedMaximum reward times reached for this user.
BuffStackLimitReached 双端
csharp
public static readonly CmdError BuffStackLimitReachedBuff stack limit reached, cannot add more stacks.
AbilityLevelLimitReached 双端
csharp
public static readonly CmdError AbilityLevelLimitReachedAbility level limit reached, cannot upgrade further.
InvalidQuestData 双端
csharp
public static readonly CmdError InvalidQuestDataQuest data is invalid or null.
QuestNotFound 双端
csharp
public static readonly CmdError QuestNotFoundQuest not found for the player.
PrerequisitesNotMet 双端
csharp
public static readonly CmdError PrerequisitesNotMetQuest prerequisites not met.
InvalidState 双端
csharp
public static readonly CmdError InvalidStateInvalid quest state for the requested operation.
ServerOnly 双端
csharp
public static readonly CmdError ServerOnlyOperation can only be performed on server.
InvalidCreateMissileData 双端
csharp
public static readonly CmdError InvalidCreateMissileDataCreateMissile mode requires valid missile unit data.
CmdResult 双端
命名空间 GameCore.BaseType
csharp
public readonly struct CmdResult<T> where T : notnullRepresents 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 InnerValueOrderQueue 双端
csharp
public static readonly ComponentTag OrderQueueWalkable 双端
csharp
public static readonly ComponentTag WalkableTurnable 双端
csharp
public static readonly ComponentTag TurnableUnitPropertyComplex 双端
csharp
public static readonly ComponentTag UnitPropertyComplexUnitLeveling 双端
csharp
public static readonly ComponentTag UnitLevelingUnitVision 双端
csharp
public static readonly ComponentTag UnitVisionAIThinkTree 双端
csharp
public static readonly ComponentTag AIThinkTreeItem 双端
csharp
public static readonly ComponentTag ItemComponentTagEx 双端
命名空间 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 AbilityManagerBuffManager 双端
csharp
public static readonly ComponentTagEx BuffManagerResponseManager 双端
csharp
public static readonly ComponentTagEx ResponseManagerInventoryManager 双端
csharp
public static readonly ComponentTagEx InventoryManagerUnitMovementController 双端
csharp
public static readonly ComponentTagEx UnitMovementControllerUnitLocomotionAnimation 双端
csharp
public static readonly ComponentTagEx UnitLocomotionAnimationContentTypeServices 双端
命名空间 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枚举值
CooldownCharge
DeathType 双端
命名空间 GameCore.BaseType
csharp
public enum DeathTypeDefines 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 FractionRepresents 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 FuncAngleFuncAngleEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncAngleEffectFuncBool 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncBoolFuncBoolEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncBoolEffectFuncFloat 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncFloatFuncFloatEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncFloatEffectFuncInt 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncIntFuncIntEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncIntEffectFuncNumber 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncNumberFuncNumberEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncNumberEffectFuncNumberExtension 双端
命名空间 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 FuncProbabilityFuncProbabilityEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncProbabilityEffectFuncRate 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncRateFuncRateEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncRateEffectFuncString 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncStringFuncStringEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncStringEffectFuncTime 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncTimeFuncTimeEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncTimeEffectFuncUInt 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncUIntFuncUIntEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate FuncUIntEffectGameRate 双端
命名空间 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 ZeroIResponseOwner 双端
命名空间 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枚举值
ABCDEFGH
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 ProbabilityRepresents 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 InnerValueTypeHash 双端
csharp
public static readonly PropertyAttachedObject TypeHashLink 双端
csharp
public static readonly PropertyAttachedObject LinkOwnerSyncId 双端
csharp
public static readonly PropertyAttachedObject OwnerSyncIdContextSyncId 双端
csharp
public static readonly PropertyAttachedObject ContextSyncIdModSeed 双端
csharp
public static readonly PropertyAttachedObject ModSeedCreationIndex 双端
csharp
public static readonly PropertyAttachedObject CreationIndexPropertySubType 双端
命名空间 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 InnerValueBase 双端
csharp
public static readonly PropertySubType BasePropertyVital 双端
命名空间 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 InnerValueHealth 双端
csharp
public static readonly PropertyVital HealthMana 双端
csharp
public static readonly PropertyVital ManaReplicateDiagnosticReason 双端
命名空间 GameCore.BaseType
csharp
public enum ReplicateDiagnosticReason枚举值
EngineMetadataSkippedHostMissingComponentMissingLinkNotVisibleNonzeroLinkDataMissingUnknownPropertyKey
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枚举值
HostPropertyComponentPropertyEngineMetadata
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 : notnullIsEnabled 双端
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 MaxMachineIdStateCounter 双端
命名空间 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>? OnStateChangeStructRange 双端
命名空间 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 HostPropertyOwnerIdEngineMetadataOwnerId 双端
csharp
public const int EngineMetadataOwnerIdSyncIdType 双端
命名空间 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 InnerValueEntity 双端
csharp
public static readonly SyncIdType EntityActor 双端
csharp
public static readonly SyncIdType ActorActorScope 双端
csharp
public static readonly SyncIdType ActorScopeAbility 双端
csharp
public static readonly SyncIdType AbilityBuff 双端
csharp
public static readonly SyncIdType BuffComponent 双端
csharp
public static readonly SyncIdType ComponentPlayer 双端
csharp
public static readonly SyncIdType PlayerGame 双端
csharp
public static readonly SyncIdType GameScene 双端
csharp
public static readonly SyncIdType ScenePropertyObject 双端
csharp
public static readonly SyncIdType PropertyObjectTargetLocation 双端
命名空间 GameCore.BaseType
csharp
public enum TargetLocation枚举值
DefaultCasterTargetMainTargetMissileSourceUnitLocalVarPointLocalVar
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 InnerValueUnit 双端
csharp
public static readonly UnitFilter UnitMissile 双端
csharp
public static readonly UnitFilter MissileHero 双端
csharp
public static readonly UnitFilter HeroGround 双端
csharp
public static readonly UnitFilter GroundAir 双端
csharp
public static readonly UnitFilter AirStructure 双端
csharp
public static readonly UnitFilter StructureItem 双端
csharp
public static readonly UnitFilter ItemUnitFilterTag 双端
命名空间 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 InnerValueUnitRelationship 双端
命名空间 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 SelfPlayer 双端
csharp
public static readonly UnitRelationship PlayerAlliance 双端
csharp
public static readonly UnitRelationship AllianceNeutral 双端
csharp
public static readonly UnitRelationship NeutralEnemy 双端
csharp
public static readonly UnitRelationship EnemyVisible 双端
csharp
public static readonly UnitRelationship VisibleUnitState 双端
命名空间 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 InnerValueInvulnerable 双端
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 InvisibleToEnemyIndicates whether the entity is invisible to enemies. This affects how enemies perceive and interact with the entity.
Detected 双端
csharp
public static readonly UnitState DetectedRevealed 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 IgnoreTerrainHeightIndicates 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 SuppressMovementTemporarily 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 DisableMovementPermanently 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 SuppressTurningTemporarily 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 DisableTurningDisables 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 ValidatorValidatorEffect 双端
命名空间 GameCore.BaseType
csharp
public delegate ValidatorEffectValidatorExtension 双端
命名空间 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.