主题
GameCore.BaseInterface
AttachedObjectExtensions 仅服务端
命名空间 GameCore.BaseInterface
csharp
public static class AttachedObjectExtensions方法
OnInstanceStateChanged 仅服务端
csharp
public static void OnInstanceStateChanged<TSelf, TCategory>(this IAttachedObject<TSelf, TCategory> obj, AttachedObjectState state) where TSelf : IAttachedObject<TSelf, TCategory> where TCategory : IGameData<TCategory>, IAttachedData<TCategory>IAttachedData 双端
命名空间 GameCore.BaseInterface
csharp
public interface IAttachedData<TCategory> : IAttachedData, IGameData<TCategory>, IGameData where TCategory : IGameData<TCategory>IAttachedObject 双端
命名空间 GameCore.BaseInterface
csharp
public interface IAttachedObject<TSelf, TCategory> : IAttachedObject<TCategory>, IAttachedObject, ISyncIdOwner, IDisposable, IGameObject<TCategory>, IGameObject, IPropertyOwner<PropertyAttachedObject>, IPropertyOwner where TSelf : IAttachedObject<TSelf, TCategory> where TCategory : IGameData<TCategory>, IAttachedData<TCategory>IAttachedObject that has a manager on the host.
属性
StackStart 双端
csharp
public uint StackStart { get; }InstanceMax 双端
csharp
public uint? InstanceMax { get; }StackMax 双端
csharp
public uint? StackMax { get; }InstanceComparison 双端
csharp
public Comparison<TSelf>? InstanceComparison { get; }MergeAction 双端
csharp
public Func<TSelf, bool>? MergeAction { get; }Manager 双端
csharp
public ObjectManager<TSelf, TCategory> Manager { get; }IsActivated 双端
csharp
public bool IsActivated { get; }IsEnabled 双端
csharp
public bool IsEnabled { get; }IsInstanceEnabled 双端
csharp
public bool IsInstanceEnabled { get; }IsLinkEnabled 双端
csharp
public bool IsLinkEnabled { get; }IsHidden 双端
csharp
public bool IsHidden { get; }RegisterHostDeath 双端
csharp
public bool RegisterHostDeath { get; }RegisterHostRevive 双端
csharp
public bool RegisterHostRevive { get; }DisableOnDeath 双端
csharp
public bool DisableOnDeath { get; }RemoveOnDeath 双端
csharp
public bool RemoveOnDeath { get; }ModificationManager 双端
csharp
public ModificationManager? ModificationManager { get; }方法
HasState 双端
csharp
bool HasState(AttachedObjectState state)ProcessHostDeathImplement 双端
csharp
void ProcessHostDeathImplement()ProcessHostDeath 双端
csharp
void ProcessHostDeath()ProcessHostReviveImplement 双端
csharp
void ProcessHostReviveImplement()ProcessHostRevive 双端
csharp
void ProcessHostRevive()OnAttached 双端
csharp
void OnAttached()Called when the object is successfully attached to its host.
AddState 仅服务端
csharp
void AddState(AttachedObjectState state)RemoveState 仅服务端
csharp
void RemoveState(AttachedObjectState state)RefreshStatesAndModifications 仅服务端
csharp
void RefreshStatesAndModifications(bool forced = false)OnInstanceStateChanged 仅服务端
csharp
void OnInstanceStateChanged(AttachedObjectState state)ICommandHandler 双端
命名空间 GameCore.BaseInterface
csharp
public interface ICommandHandler属性
Host 双端
csharp
public Entity Host { get; }方法
IssueOrder 仅服务端
csharp
CmdResult<Order> IssueOrder(Command command, bool testOnly = false)CreateOrder 仅服务端
csharp
CmdResult<Order> CreateOrder(Command command)为指令创建对应的 Order。所有 CommandIndex 都应在此处理。
备注
返回类型为 CmdResult1ofOrder, 即成功时必须返回一个 Order 实例。 对于需要立即生效且不打断当前行为的指令(如切换自动施法、无敌/解控技能), 应创建 IsTransient为 true 的 Order。 Transient Order 在OrderQueue中被自动识别并立即通过TransientExecute` 执行,不占用队列位置。
ICommandTarget 双端
命名空间 GameCore.BaseInterface
csharp
public interface ICommandTargetDefines an interface for objects that can be targeted by commands in the game.
备注
This interface serves as a marker for objects that can receive command-based interactions from players, AI, or other game systems. It's used in conjunction with the command and targeting systems to identify valid command recipients.
IContextTypeService 双端
命名空间 GameCore.BaseInterface
csharp
public interface IContextTypeService<TContext, out TBase> where TBase : class方法
CreateInstance 双端
csharp
static abstract TBase CreateInstance(TContext content)ICooldownHost 双端
命名空间 GameCore.BaseInterface
csharp
public interface ICooldownHost : ICooldownOwner, IPropertyOwner, ISyncIdOwner, IPropertyHostDefines the interface for objects that can host cooldowns and manage attached objects with synchronization support.
备注
ICooldownHost extends ICooldownOwner and IPropertyHost to provide a comprehensive hosting environment for objects that need to manage cooldowns, properties, and attached child objects. This interface is typically implemented by entities and units that serve as containers for abilities, items, and other game components. It handles synchronization of attached objects between server and client, maintains registration for lookup purposes, and provides property-based storage for complex data structures. The interface supports the attachment system used throughout the game for abilities, items, effects, and other dynamic components.
属性
ViewActor 双端
csharp
protected internal ICoreActor ViewActor { get; }Gets the core actor that represents this host in the engine.
LazyAttachedChildren 双端
csharp
protected Lazy<ValueKeyDictionary<int, IAttachedObject>> LazyAttachedChildren { get; }Gets the lazy-initialized dictionary of attached child objects.
AttachedChildren 双端
csharp
protected internal ValueKeyDictionary<int, IAttachedObject> AttachedChildren { get; }Gets the dictionary of attached child objects, creating it if necessary.
方法
GetBySyncId 双端
csharp
IAttachedObject? GetBySyncId(int syncId)Retrieves an attached object by its synchronization identifier.
syncId— The synchronization ID of the attached object to retrieve.
返回: The attached object with the specified sync ID, or null if not found.
备注
This method provides fast lookup of attached objects by their unique synchronization identifiers, which are used for network synchronization and cross-reference operations.
Register 双端
csharp
bool Register()Registers this cooldown host in the global lookup table.
返回: True if registration was successful; otherwise, throws an exception.
备注
Registration enables global lookup of this host by its view actor ID, which is essential for network synchronization and cross-object references. Each host must have a unique ID.
Unregister 双端
csharp
bool Unregister()Unregisters this cooldown host from the global lookup table.
返回: True if unregistration was successful; otherwise, false.
备注
Unregistration should be called during host disposal to prevent memory leaks and ensure proper cleanup of global references.
DisposeAttachedChildrenPool 双端
csharp
void DisposeAttachedChildrenPool()Disposes all attached child objects and cleans up the attachment pool.
备注
This method is called during host disposal to ensure all attached objects are properly destroyed and their resources are released. It only disposes children if the lazy collection has been initialized.
AddAttached 双端
csharp
bool AddAttached(IAttachedObject attached)Adds an attached object to this host's collection of children.
attached— The attached object to add.
返回: True if the object was successfully added; otherwise, false.
备注
This method handles the registration of attached objects and their synchronization setup. Only synchronized objects can be added, and each object must have a unique sync ID within the host. On the server, this also triggers network synchronization to inform clients of the new attachment.
RemoveAttached 双端
csharp
bool RemoveAttached(IAttachedObject attached)Removes an attached object from this host's collection of children.
attached— The attached object to remove.
返回: True if the object was successfully removed; otherwise, false.
备注
This method handles the deregistration of attached objects and cleanup of synchronization data. On the server, it also triggers network synchronization to inform clients of the removal.
ReplicateComponent 仅客户端
csharp
ReplicateComponentResult ReplicateComponent(int ownerId)Creates a client-side replica of a component based on synchronized data.
ownerId— The synchronization ID of the component to replicate.
返回: The component replication result.
备注
This method is used on the client side to create local instances of components that exist on the server. It retrieves the game data link and creates an appropriate attached object instance for client-side representation.
字段
ComponentsListHash 双端
csharp
static readonly long ComponentsListHashICooldownOwner 双端
命名空间 GameCore.BaseInterface
csharp
public interface ICooldownOwner : IPropertyOwner, ISyncIdOwner属性
LazyCooldownPool 双端
csharp
protected Lazy<Dictionary<IGameLink<GameDataCooldown>, Cooldown>> LazyCooldownPool { get; }CooldownPool 双端
csharp
protected Dictionary<IGameLink<GameDataCooldown>, Cooldown> CooldownPool { get; }CooldownHost 双端
csharp
public ICooldownHost CooldownHost { get; }方法
IsSyncedTimerCooldown 双端
csharp
static bool IsSyncedTimerCooldown(ICooldownHost host, long propertyHash)IsTimerCooldown 双端
csharp
static bool IsTimerCooldown(ICooldownHost host, long propertyHash)GetCooldownWithHash 双端
csharp
static Cooldown? GetCooldownWithHash(int hostActorId, long propertyHash)GetOrCreateCooldown 双端
csharp
Cooldown? GetOrCreateCooldown(IGameLink<GameDataCooldown> link)DisposeCooldownPool 双端
csharp
void DisposeCooldownPool()OnCooldownWithHash 双端
csharp
static void OnCooldownWithHash(int hostActorId, long propertyHash)OnCooldownUpdateWithHash 仅客户端
csharp
static void OnCooldownUpdateWithHash(int hostActorId, long propertyHash, TimeSpan remainingTime)OnCooldownStoppedEarlyWithHash 仅客户端
csharp
static void OnCooldownStoppedEarlyWithHash(int hostActorId, long propertyHash)OnPropertyChangedDouble 仅客户端
csharp
static void OnPropertyChangedDouble(int hostActorId, long propertyHash, double value)OnPropertyChangedBytes 仅客户端
csharp
static void OnPropertyChangedBytes(int hostActorId, long propertyHash, ReadOnlySpan<byte> valueSpan)ReplicateFromKeyValue 仅客户端
csharp
void ReplicateFromKeyValue(Enum key, ReadOnlySpan<byte> valueSpan)IExtendableEnum 双端
命名空间 GameCore.BaseInterface
csharp
public interface IExtendableEnum<TSelf> : IExtendableEnum, IExtendedEnum, ISyncIdOwner where TSelf : IExtendableEnum<TSelf>Generic interface for strongly-typed extendable enums.
备注
This interface provides type-safe factory methods for creating instances of extendable enums from their underlying enum values, enabling the extension system to work with specific enum types while maintaining type safety.
方法
MakeInstance 双端
csharp
static TSelf MakeInstance(Enum enumValue)Creates an instance of the extendable enum from an enum value.
enumValue— The enum value to wrap.
返回: A new instance of wrapping the enum value.
备注
This method provides a generic way to create extendable enum instances and delegates to the type-specific Enum) method.
Make 双端
csharp
static abstract TSelf Make(Enum enumValue)Creates an instance of the extendable enum from an enum value.
enumValue— The enum value to wrap.
返回: A new instance of wrapping the enum value.
备注
This abstract method must be implemented by concrete extendable enum types to provide type-specific instance creation logic.
IExtendedEnum 双端
命名空间 GameCore.BaseInterface
csharp
public interface IExtendedEnum : ISyncIdOwnerBase interface for extended enums that can be dynamically registered and retrieved.
备注
This interface provides the foundation for the GameCore enum extension system, allowing enums to be extended at runtime and providing efficient lookup mechanisms through hash-based mapping.
属性
InnerValue 双端
csharp
public Enum InnerValue { get; }Gets the underlying enum value wrapped by this extended enum.
EnumMap 双端
csharp
static ValueKeyDictionary<int, IExtendedEnum> EnumMap { get; }Gets the global map of all registered extended enum instances indexed by their hash codes.
备注
This static dictionary maintains all extended enum instances for efficient lookup. Values are registered during enum initialization. TODO: Consider if storing IExtendedEnum is necessary, or if storing only the inner enum would suffice.
方法
FromHashCode 双端
csharp
static IExtendedEnum? FromHashCode(int hashCode)Retrieves an extended enum instance by its hash code.
hashCode— The hash code of the enum to retrieve.
返回: The extended enum instance if found; otherwise, null.
备注
This method provides efficient lookup of extended enum instances using their hash codes, which are computed consistently across the extension system.
InnerEnumFromHashCode 双端
csharp
static Enum? InnerEnumFromHashCode(int hashCode)Retrieves the inner enum value by its hash code.
hashCode— The hash code of the enum to retrieve.
返回: The inner enum value if found; otherwise, null.
备注
This method provides direct access to the underlying enum value without the extended enum wrapper, useful for performance-critical scenarios.
IGameClass 双端
命名空间 GameCore.BaseInterface
csharp
public interface IGameClassRegister game classes that are used in the game setups.
方法
OnRegisterGameClass 双端
csharp
static abstract void OnRegisterGameClass()IHostedObject 双端
命名空间 GameCore.BaseInterface
csharp
public interface IHostedObject : ICooldownHost, ICooldownOwner, IPropertyOwner, ISyncIdOwner, IPropertyHostDefines an interface for objects that are hosted by other entities and can manage cooldowns.
备注
This interface represents objects that exist as components or attachments to host entities, inheriting cooldown management capabilities from ICooldownHost. Hosted objects typically depend on their host for lifecycle management, positioning, and other contextual information while providing their own cooldown-based functionality.
IKillable 双端
命名空间 GameCore.BaseInterface
csharp
public interface IKillableDefines an interface for entities that can be killed and potentially revived.
备注
This interface provides death state management and control for game entities. It supports different death types and contexts, allowing for varied death behaviors and revival mechanics. On the server side, it provides methods to kill and revive entities, while both server and client can check the death state.
属性
IsDead 双端
csharp
public bool IsDead { get; }Gets a value indicating whether this entity is currently dead.
方法
Kill 仅服务端
csharp
void Kill(DeathType deathType = DeathType.Normal, IExecutionContext? context = null)Kills this entity with the specified death type and execution context.
deathType— The type of death that occurred (e.g., normal, environmental, etc.).context— The execution context that caused the death, if any.
备注
This method triggers the death process for the entity, which may include playing death animations, dropping items, awarding experience, and other death-related game logic.
Revive 仅服务端
csharp
void Revive()Revives this entity, bringing it back from the dead state.
备注
This method restores the entity to a living state, typically resetting health and other vital properties. The specific revival behavior depends on the entity type and game rules.
IObjectManager 双端
命名空间 GameCore.BaseInterface
csharp
public interface IObjectManager<TObject>Defines a generic interface for managing collections or groups of objects of a specific type.
备注
This interface serves as a marker and base contract for object management systems within the game. Implementations are expected to provide specific management functionality for their object types, such as creation, destruction, tracking, and lifecycle management. The interface itself is empty to allow maximum flexibility for implementing classes to define their own management contracts.
IPropertyHost 双端
命名空间 GameCore.BaseInterface
csharp
public interface IPropertyHost : IPropertyOwner, ISyncIdOwner属性
SyncIdsByHash 双端
csharp
protected Dictionary<long, HashSet<int>>? SyncIdsByHash { get; set; }Gets or sets the collection of synchronization ID lists for different property hashes.
备注
Uses complete 64-bit property hash as key to automatically distinguish properties of different components. For host properties: hash = propertyHashCode For component properties: hash = (componentSyncId << 32) | propertyHashCode
ShouldBroadcastSyncListChange 双端
csharp
public bool ShouldBroadcastSyncListChange { get; }Whether to broadcast the sync list change. For units, we skip the broadcast when the unit is still creating.
方法
HostPropertyHash 双端
csharp
long HostPropertyHash(IExtendedEnum property)GetPropertyWithHash 双端
csharp
T? GetPropertyWithHash<T>(long propertyHash)GetComponentProperty 双端
csharp
TValue? GetComponentProperty<T, TValue>(int ownerSyncId, T property) where T : IExtendableEnumGetPropertiesWithHash 仅客户端
csharp
ReadOnlySpan<PropertyHashKeyValue> GetPropertiesWithHash(bool modifiedOnly = true)GetBytesPropertiesWithHash 仅客户端
csharp
IEnumerable<PropertyHashKeyValueBytes> GetBytesPropertiesWithHash(bool modifiedOnly = true)GetSyncListWithHash 双端
csharp
HashSet<int> GetSyncListWithHash(long propertyHash)Retrieves or creates a synchronized ID list for the specified property hash.
propertyHash— The complete 64-bit property hash.
返回: A set of synchronization IDs associated with the property hash.
AddToSyncListWithHash 双端
csharp
void AddToSyncListWithHash(long propertyHash, int valueId)Adds an ID to a synchronized property list (底层方法).
propertyHash— The complete 64-bit property hash.valueId— The ID value to add.
RemoveFromSyncListWithHash 双端
csharp
void RemoveFromSyncListWithHash(long propertyHash, int valueId)Removes an ID from a synchronized property list (底层方法).
propertyHash— The complete 64-bit property hash.valueId— The ID value to remove.
SetPropertyWithHash 仅服务端
csharp
void SetPropertyWithHash<T>(long propertyHash, T value)AddPropertyWithHash 仅服务端
csharp
void AddPropertyWithHash(long propertyHash, double value)TogglePropertyModifyEvent 仅服务端
csharp
void TogglePropertyModifyEvent(long property, bool on)SetComponentHashSyncType 仅服务端
csharp
void SetComponentHashSyncType(int syncId, SyncType type)SetPropertyHashDefaultSyncType 仅服务端
csharp
void SetPropertyHashDefaultSyncType(int propertyHash, SyncType type)IPropertyOwner 双端
命名空间 GameCore.BaseInterface
csharp
public interface IPropertyOwner<T> : IPropertyOwner, ISyncIdOwner where T : IExtendableEnum方法
PropertyHash 双端
csharp
long PropertyHash(T property)GetPropertyGeneric 双端
csharp
TValue? GetPropertyGeneric<TValue>(T property)GetProperty 双端
csharp
TValue? GetProperty<TValue>(T property)SetPropertyGeneric 仅服务端
csharp
void SetPropertyGeneric<TValue>(T property, TValue value)AddPropertyGeneric 仅服务端
csharp
void AddPropertyGeneric(T property, double value)SetProperty 仅服务端
csharp
void SetProperty<TValue>(T property, TValue value)AddProperty 仅服务端
csharp
void AddProperty(T property, double value)ISortedThink 双端
命名空间 GameCore.BaseInterface
csharp
public interface ISortedThink : IThinker属性
Priority 双端
csharp
public int? Priority { get; }IStateOwner 双端
命名空间 GameCore.BaseInterface
csharp
public interface IStateOwner<T> where T : notnullDefines an interface for objects that can manage states and immunities of a specific type.
备注
This interface provides a system for managing both active states and immunities to states. States represent conditions or effects that are active on the object, while immunities prevent certain states from being applied.
方法
HasState 双端
csharp
bool HasState(T state)Determines whether this object currently has the specified state.
state— The state to check for.
返回: true if the object has the state; otherwise, false.
AddState 仅服务端
csharp
void AddState(T state)Adds a state to this object.
state— The state to add.
备注
If the object has immunity to this state, the state may not be added.
RemoveState 仅服务端
csharp
void RemoveState(T state)Removes a state from this object.
state— The state to remove.
AddImmunity 仅服务端
csharp
void AddImmunity(T state)Adds immunity to a specific state, preventing it from being applied to this object.
state— The state to become immune to.
RemoveImmunity 仅服务端
csharp
void RemoveImmunity(T state)Removes immunity to a specific state, allowing it to be applied to this object again.
state— The state to remove immunity from.
HasImmunity 仅服务端
csharp
bool HasImmunity(T state)Determines whether this object is immune to the specified state.
state— The state to check immunity for.
返回: true if the object is immune to the state; otherwise, false.
ITarget 双端
命名空间 GameCore.BaseInterface
csharp
public interface ITarget : ICommandTargetDefines the interface for objects that can be targeted by abilities, movement, or other game systems.
备注
ITarget provides a unified interface for all objects that can serve as targets in the game world, including entities, units, scene points, and other interactive objects. It standardizes position access, validity checking, range calculations, visibility determination, and other targeting-related operations. The interface supports both server-side and client-side targeting logic with appropriate abstractions for multiplayer scenarios. All targeting systems in the game rely on this interface for consistent behavior across different object types.
属性
Position 双端
csharp
public ScenePoint Position { get; }Gets the position of this target in the game world.
Unit 双端
csharp
public Unit? Unit { get; }Gets the unit associated with this target, if applicable.
Entity 双端
csharp
public Entity? Entity { get; }Gets the entity associated with this target, if applicable.
Facing 双端
csharp
public Angle? Facing { get; }Gets the facing direction of this target, if applicable.
Scene 双端
csharp
public Scene Scene { get; }Gets the scene that contains this target.
IsValid 双端
csharp
public bool IsValid { get; }Gets a value indicating whether this target is valid and can be used for targeting operations.
CanChangePosition 双端
csharp
public bool CanChangePosition { get; }Gets a value indicating whether this target's position can be changed.
备注
Static targets like waypoints or fixed positions return false, while dynamic targets like units return true. This affects how movement and positioning systems interact with the target.
ApproachableTarget 双端
csharp
public IApproachableTarget ApproachableTarget { get; }Gets the approachable target interface for pathfinding and movement systems.
InteractRadius 双端
csharp
public float InteractRadius { get; }Gets the interaction radius of this target for range and collision calculations.
备注
The interaction radius affects how close other objects need to be to interact with this target. Larger objects typically have larger interaction radii to account for their size.
IsChangingPosition 仅服务端
csharp
public bool IsChangingPosition { get; }Gets a value indicating whether this target is currently changing its position.
备注
This property is only available on the server side and is used to track movement states for synchronization and prediction purposes.
方法
IsValidTargetTo 双端
csharp
bool IsValidTargetTo(Entity caster, bool isRequest)Determines whether this target is valid for targeting by the specified caster.
caster— The entity attempting to target this object.isRequest— Whether this is a targeting request that requires visibility.
返回: True if this target can be targeted by the caster; otherwise, false.
备注
This method checks basic targeting validity such as being in the same scene. Derived implementations may add additional checks for visibility, relationships, or other factors.
IsInRange 双端
csharp
bool IsInRange(Entity caster, double range, bool isRequest)Determines whether this target is within the specified range of the caster.
caster— The entity checking range to this target.range— The maximum range to check.isRequest— Whether this is a targeting request that requires validity.
返回: True if the target is within range; otherwise, false.
备注
Range calculation includes the interaction radii of both the caster and target to account for object sizes. The method also verifies targeting validity before checking distance.
SameScene 双端
csharp
bool SameScene(ITarget target)Determines whether this target is in the same scene as another target.
target— The target to compare scenes with.
返回: True if both targets are in the same scene; otherwise, false.
备注
Scene comparison is fundamental for many targeting operations, as cross-scene targeting is typically not supported. This method provides a standard way to check scene compatibility.
CanBeSeen 双端
csharp
bool CanBeSeen(Entity caster)Determines whether this target can be seen by the specified caster.
caster— The entity attempting to see this target.
返回: True if this target is visible to the caster; otherwise, false.
备注
Visibility rules vary by implementation and may consider factors such as line of sight, fog of war, stealth effects, and player relationships. This method must be implemented by concrete target types to provide appropriate visibility logic.
AngleTo 双端
csharp
Angle? AngleTo(ITarget target)Calculates the angle from this target to another target.
target— The target to calculate the angle to.
返回: The angle to the target, or null if they are at the same position or in different scenes.
备注
If the targets are at the same position, this method returns the current facing direction. Otherwise, it calculates the angle based on the relative positions of the two targets.
VectorTargetPosition 双端
csharp
ScenePoint? VectorTargetPosition(ITarget target, double vectorLength)Calculates a position at a specified distance in the direction of another target.
target— The target to calculate the vector towards.vectorLength— The distance from this target's position.
返回: The calculated scene point, or null if the targets are in different scenes.
备注
This method is useful for positioning effects, projectiles, or other objects at a specific distance in the direction of a target. The vector length is adjusted by this target's interaction radius to account for object size.
事件
OnPositionChangingStart 仅服务端
csharp
event Action<ITarget>? OnPositionChangingStartOccurs when this target starts changing its position.
备注
This event is fired when the target begins a movement operation. It's useful for systems that need to track movement states or respond to position changes.
OnPositionChangingEnd 仅服务端
csharp
event Action<ITarget>? OnPositionChangingEndOccurs when this target finishes changing its position.
备注
This event is fired when the target completes a movement operation. It's useful for systems that need to track movement states or respond to position changes.
IThinker 双端
命名空间 GameCore.BaseInterface
csharp
public interface IThinkerDefines an interface for objects that require regular update processing each game tick.
备注
The thinking system allows objects to perform per-frame logic such as AI processing, animation updates, timers, or other time-based behaviors. Objects can enable or disable their thinking state dynamically to optimize performance by only processing active objects.
属性
DoesThink 双端
csharp
public bool DoesThink { get; set; }Gets or sets a value indicating whether this object should be included in the thinking system.
备注
When set to true, the object is registered with the game's thinking system and Int32) will be called each tick. When set to false, the object is unregistered and stops receiving think calls, improving performance for inactive objects.
方法
Think 双端
csharp
void Think(int delta)Performs the object's per-tick thinking logic.
delta— The time elapsed since the last tick, in milliseconds.
备注
This method is called every game tick when DoesThink is true. Implementations should perform their frame-based logic here, such as AI decisions, state updates, or timer processing.
字段
thinkState 双端
csharp
protected static readonly HashSet<IThinker> thinkStateIThinkerStaggered 双端
命名空间 GameCore.BaseInterface
csharp
public interface IThinkerStaggered属性
StaggeredCount 双端
csharp
public int StaggeredCount { get; }DoesThink 双端
csharp
public bool DoesThink { get; set; }方法
Think 双端
csharp
void Think()Only think when DoesThink = true;
ITickFinalizer 双端
命名空间 GameCore.BaseInterface
csharp
public interface ITickFinalizerDefines an interface for objects that need to perform cleanup or finalization operations at the end of each game tick.
备注
This interface is used for objects that need to execute logic after all other tick processing has completed. Implementations should register themselves using PendingFinalizer to be included in the finalization process.
方法
TickFinalizer 双端
csharp
void TickFinalizer()Performs finalization operations at the end of a game tick.
备注
This method is called after all other tick processing has completed for the current frame. It should be used for cleanup operations, state finalization, or any logic that needs to run after all other systems have updated.
PendingFinalizer 双端
csharp
void PendingFinalizer()Registers this object to be processed during the tick finalization phase.
备注
Call this method to ensure that TickFinalizer will be called at the end of the current or next tick. The object will be automatically managed by the game's tick finalization system.
IUnitModificationData 双端
命名空间 GameCore.BaseInterface
csharp
public interface IUnitModificationDataDefines data for modifying unit properties, states, and immunities.
备注
This interface represents a collection of modifications that can be applied to units, including property changes, state additions/removals, and immunity grants. It's commonly used by abilities, items, and other game systems that need to modify unit characteristics temporarily or permanently.
属性
Modifications 双端
csharp
public List<UnitPropertyModification> Modifications { get; }Gets a list of property modifications to apply to the unit.
备注
These modifications can change unit attributes like damage, armor, speed, etc. Each modification specifies the property to change and how to change it.
AddStates 双端
csharp
public List<UnitState> AddStates { get; }Gets a list of states to add to the unit.
备注
States represent temporary or permanent conditions that affect unit behavior, such as buffs, debuffs, or special status effects.
RemoveStates 双端
csharp
public List<UnitState> RemoveStates { get; }Gets a list of states to remove from the unit.
备注
This can be used to clear specific states or conditions from the unit, such as removing debuffs or clearing temporary effects.
ImmuneStates 双端
csharp
public List<UnitState> ImmuneStates { get; }Gets a list of states that the unit should become immune to.
备注
Immune states prevent the unit from being affected by specific conditions, providing protection against certain types of effects or abilities.
PropertyOwnerExtension 双端
命名空间 GameCore.BaseInterface
csharp
public static class PropertyOwnerExtension方法
GetProperty 双端
csharp
public static TValue? GetProperty<T, TValue>(this IPropertyOwner<T> owner, T property) where T : IExtendableEnumSetProperty 仅服务端
csharp
public static void SetProperty<T, TValue>(this IPropertyOwner<T> owner, T property, TValue value) where T : IExtendableEnumAddProperty 仅服务端
csharp
public static void AddProperty<T, TValue>(this IPropertyOwner<T> owner, T property, double value) where T : IExtendableEnumReplicateComponentResult 双端
命名空间 GameCore.BaseInterface
csharp
public readonly struct ReplicateComponentResult : IEquatable<ReplicateComponentResult>构造函数
ReplicateComponentResult 双端
csharp
public ReplicateComponentResult(ReplicateComponentStatus Status, IAttachedObject? Component)属性
Status 双端
csharp
public ReplicateComponentStatus Status { get; init; }Component 双端
csharp
public IAttachedObject? Component { get; init; }HasComponent 双端
csharp
public bool HasComponent { get; }方法
ToString 双端
csharp
public override string ToString()operator != 双端
csharp
public static bool operator !=(ReplicateComponentResult left, ReplicateComponentResult right)operator == 双端
csharp
public static bool operator ==(ReplicateComponentResult left, ReplicateComponentResult right)GetHashCode 双端
csharp
public override int GetHashCode()Equals 双端
csharp
public override bool Equals(object obj)Equals 双端
csharp
public bool Equals(ReplicateComponentResult other)Deconstruct 双端
csharp
public void Deconstruct(out ReplicateComponentStatus Status, out IAttachedObject? Component)ReplicateComponentStatus 双端
命名空间 GameCore.BaseInterface
csharp
public enum ReplicateComponentStatus枚举值
ReplicatedAlreadyExistsLinkNotVisible