/// <summary> /// Initializes a new instance of the <see cref="RegionUpdateOperation"/> class. /// </summary> /// <param name="region">The region.</param> /// <param name="type">The type.</param> /// <param name="entity">The entity.</param> public RegionUpdateOperation(IRegion region, EntityUpdateType type, Entity entity) { Guard.Argument(region).NotNull(); Guard.Argument(entity).NotNull(); _region = region; _type = type; _entity = entity; }
public void Execute(IRegion region, Entity entity, EntityUpdateType type) { var entityType = entity.EntityType; if (!entityType.IsMob() && entity is IGroupableEntity) { region.Record(entity, type); } }
/// <summary> /// Initializes a new instance of the <see cref="ObjectUpdateOperation"/> class. /// </summary> /// <param name="region">The region which the ObjectUpdateOperation occured. Must not be <c>null</c>.</param> /// <param name="type">The type.</param> /// <param name="obj">The object.</param> public ObjectUpdateOperation(IRegion region, EntityUpdateType type, GameObject obj) : base(region, type, obj) { }
public IRegionUpdateOperation ToUpdateOperation(IRegion region, EntityUpdateType type) { return(new ObjectUpdateOperation(region, type, this)); }