Restructure solution

This commit is contained in:
sardelka9515
2022-10-15 11:51:18 +08:00
parent 42c0ef2159
commit d1b4f23992
130 changed files with 458 additions and 578 deletions

View File

@ -0,0 +1,42 @@
using GTA;
namespace RageCoop.Client
{
/// <summary>
/// Synchronized prop, mostly owned by server
/// </summary>
public class SyncedProp : SyncedEntity
{
internal SyncedProp(int id)
{
ID = id;
}
/// <summary>
/// The real entity
/// </summary>
public Prop MainProp { get; set; }
internal new int OwnerID
{
get
{
// alwayse owned by server
return 0;
}
}
internal override void Update()
{
if (!NeedUpdate) { return; }
if (!Model.IsLoaded) { Model.Request(); return; }
if (MainProp == null || !MainProp.Exists())
{
MainProp = World.CreateProp(Model, Position, Rotation, false, false);
MainProp.IsInvincible = true;
}
MainProp.Position = Position;
MainProp.Rotation = Rotation;
MainProp.SetFrozen(true);
LastUpdated = Main.Ticked;
}
}
}