using Microsoft.Xna.Framework; using V3.Objects; namespace V3.AI.Internal { /// /// Spawns a creature at a given position. /// // ReSharper disable once ClassNeverInstantiated.Global public class SpawnAction : AbstractAction { private readonly IObjectsManager mObjectsManager; private ICreature mCreature; private Vector2 mPosition; /// /// Creates a new SpawnAction that spawns the given creature at the /// given position. /// /// the linked objects manager /// the creature to spawn /// the spawn position public SpawnAction(IObjectsManager objectsManager, ICreature creature, Vector2 position) { mObjectsManager = objectsManager; mCreature = creature; mPosition = position; } public override void Start() { mCreature.Position = mPosition; mObjectsManager.CreateCreature(mCreature); base.Start(); } protected override ActionState GetNextState() { return ActionState.Done; } } }