Skip to content

Commit

Permalink
Rename RoofState to IsRoofClosed
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Dec 27, 2022
1 parent 97f1d0e commit b6f6f26
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions api/AltV.Net.Async/AltAsync.Vehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ public static Task SetStateAsync(this IVehicle vehicle, string state) =>
AltVAsync.Schedule(() => vehicle.State = state);

[Obsolete("Use async entities instead")]
public static Task<bool> GetRoofStateAsync(this IVehicle vehicle) =>
AltVAsync.Schedule(() => vehicle.RoofState);
public static Task<bool> IsRoofClosedAsync(this IVehicle vehicle) =>
AltVAsync.Schedule(() => vehicle.IsRoofClosed);

[Obsolete("Use async entities instead")]
public static Task SetRoofStateAsync(this IVehicle vehicle, bool roofState) =>
AltVAsync.Schedule(() => vehicle.RoofState = roofState);
public static Task SetRoofClosedAsync(this IVehicle vehicle, bool roofState) =>
AltVAsync.Schedule(() => vehicle.IsRoofClosed = roofState);

[Obsolete("Use async entities instead")]
public static Task<byte> GetDoorStateAsync(this IVehicle vehicle, byte doorId) =>
Expand Down
6 changes: 3 additions & 3 deletions api/AltV.Net.Async/Elements/Entities/AsyncVehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -877,22 +877,22 @@ public bool IsNightlightOn
}
}

public bool RoofState
public bool IsRoofClosed
{
get
{
lock (Vehicle)
{
if (!AsyncContext.CheckIfExistsOrCachedNullable(Vehicle)) return default;
return Vehicle.RoofState;
return Vehicle.IsRoofClosed;
}
}
set
{
lock (Vehicle)
{
if (!AsyncContext.CheckIfExistsNullable(Vehicle)) return;
Vehicle.RoofState = value;
Vehicle.IsRoofClosed = value;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/AltV.Net.Async/Elements/Entities/VehicleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public IVehicleBuilder LockState(VehicleLockState value)
return this;
}

public IVehicleBuilder RoofState(bool state)
public IVehicleBuilder IsRoofClosed(bool state)
{
Add(ptr =>
{
Expand Down
2 changes: 1 addition & 1 deletion api/AltV.Net.Async/IVehicleBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface IVehicleBuilder : IDisposable
IVehicleBuilder HeadlightColor(byte value);
IVehicleBuilder SirenActive(bool value);
IVehicleBuilder LockState(VehicleLockState value);
IVehicleBuilder RoofState(bool state);
IVehicleBuilder IsRoofClosed(bool state);
IVehicleBuilder State(string value);
IVehicleBuilder EngineHealth(int value);
IVehicleBuilder PetrolTankHealth(int value);
Expand Down
4 changes: 2 additions & 2 deletions api/AltV.Net/Elements/Entities/IVehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ public interface IVehicle : ISharedVehicle, IEntity
bool IsNightlightOn { get; }

/// <summary>
/// Sets the Roof state (false = open, true = closed)
/// Sets the Roof closed
/// </summary>
bool RoofState { get; set; }
bool IsRoofClosed { get; set; }

/// <summary>
/// If the flamethrower is active
Expand Down
2 changes: 1 addition & 1 deletion api/AltV.Net/Elements/Entities/Vehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ public bool IsNightlightOn
}
}

public bool RoofState
public bool IsRoofClosed
{
get
{
Expand Down

0 comments on commit b6f6f26

Please sign in to comment.