public IVehicle CreateVehicle(uint model, Position pos, float heading) { var ptr = MockEntities.GetNextPtr(); vehiclePool.Create(ptr, MockEntities.Id, out var vehicle); vehicle.Position = pos; //TODO: apis missing for more properties from create MockEntities.Insert(vehicle); return(vehicle); }
public IPlayer ConnectPlayer(string playerName, string reason, Action <IPlayer> intercept = null) { var ptr = MockEntities.GetNextPtr(); Alt.Module.PlayerPool.Create(ptr, MockEntities.Id, out var player); player.Name = playerName; intercept?.Invoke(player); MockEntities.Insert(player); Alt.Module.OnPlayerConnect(ptr, player.Id, reason); return(player); }
public IVoiceChannel CreateVoiceChannel(bool spatial, float maxDistance) { var ptr = MockEntities.GetNextPtrNoId(); voiceChannelPool.Create(ptr, out var voiceChannel); if (voiceChannel is MockVoiceChannel mockVoiceChannel) { mockVoiceChannel.IsSpatial = spatial; mockVoiceChannel.MaxDistance = maxDistance; } Alt.Module.OnCreateVoiceChannel(ptr); return(voiceChannel); }
public IBlip CreateBlip(IPlayer player, byte type, Position pos) { var ptr = MockEntities.GetNextPtrNoId(); blipPool.Create(ptr, out var blip); if (blip is MockBlip mockBlip) { mockBlip.Position = pos; mockBlip.BlipType = type; } Alt.Module.OnCreateBlip(ptr); return(blip); }
public IBlip CreateBlip(IPlayer player, byte type, Position pos) { var ptr = MockEntities.GetNextPtrNoId(); var blip = blipPool.Create(this, ptr); if (blip is MockBlip mockBlip) { mockBlip.Position = pos; mockBlip.BlipType = type; } Alt.CoreImpl.OnCreateBlip(ptr); return(blip); }
public IBlip CreateBlip(IPlayer player, byte type, IEntity entityAttach) { var ptr = MockEntities.GetNextPtrNoId(); blipPool.Create(ptr, out var blip); if (blip is MockBlip mockBlip) { mockBlip.BlipType = type; mockBlip.IsAttached = true; mockBlip.AttachedTo = entityAttach; } Alt.Module.OnCreateBlip(ptr); return(blip); }
public ICheckpoint CreateCheckpoint(IPlayer player, byte type, Position pos, float radius, float height, Rgba color) { var ptr = MockEntities.GetNextPtrNoId(); checkpointPool.Create(ptr, out var checkpoint); if (checkpoint is MockCheckpoint mockCheckpoint) { mockCheckpoint.Position = pos; mockCheckpoint.CheckpointType = type; mockCheckpoint.Radius = radius; mockCheckpoint.Height = height; mockCheckpoint.Color = color; } Alt.Module.OnCreateCheckpoint(ptr); return(checkpoint); }
public override void OnRemove(IVoiceChannel entity) { MockEntities.FreeNoId(entity.NativePointer); }
public override void OnRemove(IPlayer entity) { MockEntities.Free(entity.NativePointer, entity.Id); }
public override void OnRemove(IColShape entity) { MockEntities.FreeNoId(entity.NativePointer); }