More actor and UObject progress

This commit is contained in:
AeonLucid
2022-01-17 23:02:10 +01:00
parent fe97b7a145
commit 458bae0523
24 changed files with 421 additions and 18 deletions
+39 -3
View File
@@ -1,11 +1,18 @@
using Prospect.Unreal.Core;
using Prospect.Unreal.Core.Objects;
using Prospect.Unreal.Runtime;
namespace Prospect.Unreal.Net.Actors;
public class AActor
public class AActor : UObject
{
private bool bActorInitialized;
// TODO: UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_Instigator, meta=(ExposeOnSpawn=true, AllowPrivateAccess=true), Category=Actor)
/// <summary>
/// Pawn responsible for damage and other gameplay events caused by this actor.
/// </summary>
private APawn? _instigator;
/// <summary>
/// Sets the value of Role without causing other side effects to this instance.
@@ -36,9 +43,38 @@ public class AActor
throw new NotImplementedException();
}
public UWorld GetWorld()
public UWorld? GetWorld()
{
// if ()
if (!HasAnyFlags(EObjectFlags.RF_ClassDefaultObject))
{
var outer = GetOuter();
if (outer == null)
{
return null;
}
if (!outer.HasAnyFlags(EObjectFlags.RF_BeginDestroyed) &&
!outer.IsUnreachable())
{
var level = GetLevel();
if (level != null)
{
return level.OwningWorld;
}
}
}
return null;
}
public ULevel? GetLevel()
{
return GetTypedOuter<ULevel>();
}
public APawn? GetInstigator()
{
return _instigator;
}
public bool IsActorInitialized()