Skip to content

Commit

Permalink
Merge pull request #841 from FlorianV85/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianTerhorst authored Jan 28, 2024
2 parents e1f17e9 + d8bb3f4 commit 05a8632
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/articles/getting-started/entity-factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MyPlayer : Player
{
public bool LoggedIn { get; set; }

public MyPlayer(ICore core, IntPtr nativePointer, ushort id) : base(core, nativePointer, id)
public MyPlayer(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id)
{
LoggedIn = false;
}
Expand All @@ -27,12 +27,12 @@ Thats why you need to create a factory that will create the player for you when
## Step 2, Create the factory

In the factory the defined default constructor of the player or vehicle class will be called.
You only need to override the ```IPlayer Create(IntPtr playerPointer, ushort id)``` method and initialize your own class instead of the default one.
You only need to override the ```IPlayer Create(IntPtr playerPointer, uint id)``` method and initialize your own class instead of the default one.

```csharp
public class MyPlayerFactory : IEntityFactory<IPlayer>
{
public IPlayer Create(ICore core, IntPtr playerPointer, ushort id)
public IPlayer Create(ICore core, IntPtr playerPointer, uint id)
{
return new MyPlayer(core, playerPointer, id);
}
Expand Down Expand Up @@ -63,7 +63,7 @@ public class MyVehicle : Vehicle
public int MyData { get; set; }

// This constructor is used for creation via entity factory
public MyVehicle(ICore core, IntPtr nativePointer, ushort id) : base(core, nativePointer, id)
public MyVehicle(ICore core, IntPtr nativePointer, uint id) : base(core, nativePointer, id)
{
MyData = 6;
}
Expand Down

0 comments on commit 05a8632

Please sign in to comment.