-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-added enums , changed module, changed factories to activator utils
- Loading branch information
1 parent
3391927
commit a0108d9
Showing
11 changed files
with
285 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace AltV.Atlas.Vehicles.Enums; | ||
|
||
public enum EColorMaterial | ||
{ | ||
Metallic, | ||
Matte, | ||
Util, | ||
Worn, | ||
Chrome, | ||
Brushed, | ||
DefaultAlloy | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
namespace AltV.Atlas.Vehicles.Enums; | ||
|
||
public enum EGtaColor | ||
{ | ||
MetallicBlack, | ||
MetallicGraphiteBlack, | ||
MetallicBlackSteal, | ||
MetallicDarkSilver, | ||
MetallicSilver, | ||
MetallicBlueSilver, | ||
MetallicSteelGray, | ||
MetallicShadowSilver, | ||
MetallicStoneSilver, | ||
MetallicMidnightSilver, | ||
MetallicGunMetal, | ||
MetallicAnthraciteGrey, | ||
MatteBlack, | ||
MatteGray, | ||
MatteLightGrey, | ||
UtilBlack, | ||
UtilBlackPoly, | ||
UtilDarkSilver, | ||
UtilSilver, | ||
UtilGunMetal, | ||
UtilShadowSilver, | ||
WornBlack, | ||
WornGraphite, | ||
WornSilverGrey, | ||
WornSilver, | ||
WornBlueSilver, | ||
WornShadowSilver, | ||
MetallicRed, | ||
MetallicTorinoRed, | ||
MetallicFormulaRed, | ||
MetallicBlazeRed, | ||
MetallicGracefulRed, | ||
MetallicGarnetRed, | ||
MetallicDesertRed, | ||
MetallicCabernetRed, | ||
MetallicCandyRed, | ||
MetallicSunriseOrange, | ||
MetallicClassicGold, | ||
MetallicOrange, | ||
MatteRed, | ||
MatteDarkRed, | ||
MatteOrange, | ||
MatteYellow, | ||
UtilRed, | ||
UtilBrightRed, | ||
UtilGarnetRed, | ||
WornRed, | ||
WornGoldenRed, | ||
WornDarkRed, | ||
MetallicDarkGreen, | ||
MetallicRacingGreen, | ||
MetallicSeaGreen, | ||
MetallicOliveGreen, | ||
MetallicGreen, | ||
MetallicGasolineBlueGreen, | ||
MatteLimeGreen, | ||
UtilDarkGreen, | ||
UtilGreen, | ||
WornDarkGreen, | ||
WornGreen, | ||
WornSeaWash, | ||
MetallicMidnightBlue, | ||
MetallicDarkBlue, | ||
MetallicSaxonyBlue, | ||
MetallicBlue, | ||
MetallicMarinerBlue, | ||
MetallicHarborBlue, | ||
MetallicDiamondBlue, | ||
MetallicSurfBlue, | ||
MetallicNauticalBlue, | ||
MetallicBrightBlue, | ||
MetallicPurpleBlue, | ||
MetallicSpinnakerBlue, | ||
MetallicUltraBlue, | ||
MetallicBrightBlue2, | ||
UtilDarkBlue, | ||
UtilMidnightBlue, | ||
UtilBlue, | ||
UtilSeaFoamBlue, | ||
UtilLightningBlue, | ||
UtilMauiBluePoly, | ||
UtilBrightBlue3, | ||
MatteDarkBlue, | ||
MatteBlue, | ||
MatteMidnightBlue, | ||
WornDarkBlue, | ||
WornBlue, | ||
WornLightBlue, | ||
MetallicTaxiYellow, | ||
MetallicRaceYellow, | ||
MetallicBronze, | ||
MetallicYellowBird, | ||
MetallicLime, | ||
MetallicChampagne, | ||
MetallicPuebloBeige, | ||
MetallicDarkIvory, | ||
MetallicChocoBrown, | ||
MetallicGoldenBrown, | ||
MetallicLightBrown, | ||
MetallicStrawBeige, | ||
MetallicMossBrown, | ||
MetallicBistonBrown, | ||
MetallicBeechwood, | ||
MetallicDarkBeechwood, | ||
MetallicChocoOrange, | ||
MetallicBeachSand, | ||
MetallicSunBleechedSand, | ||
MetallicCream, | ||
UtilBrown, | ||
UtilMediumBrown, | ||
UtilLightBrown, | ||
MetallicWhite, | ||
MetallicFrostWhite, | ||
WornHoneyBeige, | ||
WornBrown, | ||
WornDarkBrown, | ||
WornStrawBeige, | ||
BrushedSteel, | ||
BrushedBlackSteel, | ||
BrushedAluminium, | ||
Chrome, | ||
WornOffWhite, | ||
UtilOffWhite, | ||
WornOrange, | ||
WornLightOrange, | ||
MetallicSecuricorGreen, | ||
WornTaxiYellow, | ||
PoliceCarBlue, | ||
MatteGreen, | ||
MatteBrown, | ||
WornOrange2, | ||
MatteWhite, | ||
WornWhite, | ||
WornOliveArmyGreen, | ||
PureWhite, | ||
HotPink, | ||
SalmonPink, | ||
MetallicVermillionPink, | ||
Orange, | ||
Green, | ||
Blue, | ||
MettalicBlackBlue, | ||
MetallicBlackPurple, | ||
MetallicBlackRed, | ||
HunterGreen, | ||
MetallicPurple, | ||
MetaillicVDarkBlue, | ||
ModshopBlack, | ||
MattePurple, | ||
MatteDarkPurple, | ||
MetallicLavaRed, | ||
MatteForestGreen, | ||
MatteOliveDrab, | ||
MatteDesertBrown, | ||
MatteDesertTan, | ||
MatteFoilageGreen, | ||
DefaultAlloy, | ||
EpsilonBlue, | ||
PureGold, | ||
BrushedGold | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace AltV.Atlas.Vehicles.Enums; | ||
|
||
public enum EHeadlightColor | ||
{ | ||
White, | ||
Darkblue, | ||
Lightblue, | ||
Turquoise, | ||
Green, | ||
Yellow, | ||
Gold, | ||
Orange, | ||
Red, | ||
Pink, | ||
Violet, | ||
Purple, | ||
Ultraviolet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace AltV.Atlas.Vehicles.Enums; | ||
|
||
public enum EWheelType | ||
{ | ||
Sport, | ||
Muscle, | ||
Lowrider, | ||
SUV, | ||
Offroad, | ||
Tuner, | ||
BikeWheels, | ||
HighEnd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
using AltV.Net; | ||
using AltV.Atlas.Vehicles.Interfaces; | ||
using AltV.Net; | ||
using Microsoft.Extensions.Logging; | ||
namespace AltV.Atlas.Vehicles.Factories.Entities; | ||
|
||
public class AtlasTuningVehicle : AtlasVehicle | ||
{ | ||
|
||
public AtlasTuningVehicle( ICore core, IntPtr nativePointer, uint id ) : base( core, nativePointer, id ) | ||
public AtlasTuningVehicle( ILogger<IAtlasVehicle> logger, ICore core, IntPtr nativePointer, uint id ) : base( logger, core, nativePointer, id ) | ||
{ | ||
} | ||
public AtlasTuningVehicle( uint vehicleId, ICore core, IntPtr nativePointer, uint id ) : base( vehicleId, core, nativePointer, id ) | ||
public AtlasTuningVehicle( ILogger<IAtlasVehicle> logger, uint vehicleId, ICore core, IntPtr nativePointer, uint id ) : base( logger, vehicleId, core, nativePointer, id ) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using AltV.Atlas.Vehicles.Factories.Entities; | ||
using AltV.Net; | ||
using AltV.Net.Elements.Entities; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace AltV.Atlas.Vehicles.Factories.EntityFactories; | ||
|
||
public class AltVehicleFactory : IEntityFactory<IVehicle> | ||
{ | ||
private readonly IServiceProvider _serviceProvider; | ||
|
||
public AltVehicleFactory( IServiceProvider serviceProvider ) | ||
{ | ||
_serviceProvider = serviceProvider; | ||
} | ||
|
||
public IVehicle Create( ICore core, IntPtr entityPointer, uint id ) | ||
{ | ||
return ActivatorUtilities.CreateInstance<AtlasVehicle>( _serviceProvider, core, entityPointer, id ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
using AltV.Atlas.Vehicles.Factories.Entities; | ||
using AltV.Net; | ||
using AltV.Net.Elements.Entities; | ||
using AltV.Atlas.Vehicles.Interfaces; | ||
using AltV.Net.Async; | ||
using AltV.Net.Data; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace AltV.Atlas.Vehicles.Factories.EntityFactories; | ||
|
||
public class AtlasVehicleFactory : IEntityFactory<IVehicle> | ||
public class AtlasVehicleFactory | ||
{ | ||
public IVehicle Create( ICore core, IntPtr entityPointer, uint id ) | ||
private readonly ILogger<AtlasVehicleFactory> _logger; | ||
|
||
public AtlasVehicleFactory( ILogger<AtlasVehicleFactory> logger ) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public async Task<T> CreateVehicleAsync<T>( uint model, Position position, Rotation rotation ) where T : IAtlasVehicle | ||
{ | ||
return new AtlasVehicle( core, entityPointer, id ); | ||
return ( T ) await AltAsync.CreateVehicle( model, position, rotation ); | ||
} | ||
|
||
public async Task<IAtlasVehicle> CreateVehicleAsync( uint model, Position position, Rotation rotation ) | ||
{ | ||
return ( IAtlasVehicle ) await AltAsync.CreateVehicle( model, position, rotation ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using AltV.Net.Data; | ||
using AltV.Net.Elements.Entities; | ||
namespace AltV.Atlas.Vehicles.Interfaces; | ||
|
||
public interface IAtlasVehicle | ||
{ | ||
uint VehicleId { get; } | ||
uint Fuel { get; } | ||
void SpawnVehicle( Position pos, Rotation rot, uint model ); | ||
void WarpOutOfVehicle( IPlayer player ); | ||
bool LockVehicle( object item ); | ||
bool LockVehicle( IPlayer player ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
using AltV.Atlas.Vehicles.Factories.Entities; | ||
using AltV.Atlas.Vehicles.Factories.EntityFactories; | ||
using AltV.Atlas.Vehicles.Interfaces; | ||
using AltV.Net; | ||
using AltV.Net.Async.Elements.Entities; | ||
using AltV.Net.Elements.Entities; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace AltV.Atlas.Vehicles; | ||
|
||
public static class VehicleModule | ||
{ | ||
public static IServiceCollection RegisterPedModule( this IServiceCollection serviceCollection ) | ||
public static IServiceCollection RegisterVehicleModule( this IServiceCollection serviceCollection ) | ||
{ | ||
serviceCollection.AddTransient<AtlasVehicle>( ); | ||
serviceCollection.AddTransient<IAtlasVehicle, AtlasVehicle>( ); | ||
serviceCollection.AddTransient<AtlasVehicleFactory>( ); | ||
serviceCollection.AddTransient<IVehicle, AsyncVehicle>( ); | ||
|
||
//serviceCollection.AddTransient<IEntityFactory<IPed>, AtlasVehicleFactory>( ); | ||
serviceCollection.AddTransient<IEntityFactory<IVehicle>, AltVehicleFactory>( ); | ||
|
||
return serviceCollection; | ||
} | ||
} |