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.GetNextPtr(); voiceChannelPool.Create(ptr, out var voiceChannel); if (voiceChannel is MockVoiceChannel mockVoiceChannel) { mockVoiceChannel.IsSpatial = spatial; mockVoiceChannel.MaxDistance = maxDistance; } MockEntities.Insert(voiceChannel); return(voiceChannel); }
public IBlip CreateBlip(IPlayer player, byte type, Position pos) { var ptr = MockEntities.GetNextPtr(); blipPool.Create(ptr, out var blip); if (blip is MockBlip mockBlip) { mockBlip.Position = pos; mockBlip.BlipType = type; } MockEntities.Insert(blip); return(blip); }
public IBlip CreateBlip(IPlayer player, byte type, IEntity entityAttach) { var ptr = MockEntities.GetNextPtr(); blipPool.Create(ptr, out var blip); if (blip is MockBlip mockBlip) { mockBlip.BlipType = type; mockBlip.IsAttached = true; mockBlip.AttachedTo = entityAttach; } MockEntities.Insert(blip); return(blip); }
public ICheckpoint CreateCheckpoint(IPlayer player, byte type, Position pos, float radius, float height, Rgba color) { var ptr = MockEntities.GetNextPtr(); 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; } MockEntities.Insert(checkpoint); return(checkpoint); }