コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 public override void OnRemove(IVoiceChannel entity)
 {
     MockEntities.FreeNoId(entity.NativePointer);
 }
コード例 #9
0
 public override void OnRemove(IPlayer entity)
 {
     MockEntities.Free(entity.NativePointer, entity.Id);
 }
コード例 #10
0
 public override void OnRemove(IColShape entity)
 {
     MockEntities.FreeNoId(entity.NativePointer);
 }