41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System.Collections.Concurrent;
|
|
using GameServer.Dungeon;
|
|
|
|
namespace GameServer.Shared;
|
|
|
|
/// <summary>
|
|
/// Abstraction over the spatial/entity environment that MobAI and combat systems need.
|
|
/// Implemented by both DungeonSimulation (dungeons) and WorldZoneSimulation (overworld).
|
|
/// </summary>
|
|
public interface ICombatEnvironment
|
|
{
|
|
// ---- Spatial ----
|
|
|
|
/// <summary>Check if an actor-sized entity can move to the given world-pixel position.</summary>
|
|
bool CanActorMoveTo(float x, float y);
|
|
|
|
// ---- Entity lookups ----
|
|
|
|
/// <summary>All alive players in this environment.</summary>
|
|
IEnumerable<IPlayerTarget> GetAlivePlayers();
|
|
|
|
/// <summary>All alive mobs in this environment.</summary>
|
|
ConcurrentDictionary<int, MobInstance> Mobs { get; }
|
|
|
|
/// <summary>Get a specific player by character ID.</summary>
|
|
IPlayerTarget? GetPlayer(ulong characterId);
|
|
|
|
// ---- Mob summoning ----
|
|
|
|
/// <summary>Request spawning a new mob (summoner ability).</summary>
|
|
void RequestMobSummon(int mobDefinitionId, float x, float y, int tier);
|
|
|
|
// ---- Context ----
|
|
|
|
/// <summary>The tier/difficulty level of this environment (dungeon tier or world zone level).</summary>
|
|
int Tier { get; }
|
|
|
|
/// <summary>Current simulation tick.</summary>
|
|
long CurrentTick { get; }
|
|
}
|