Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor for objects #1209

Closed
wants to merge 3 commits into from

Conversation

killzoms
Copy link
Collaborator

@killzoms killzoms commented Aug 8, 2020

  • Implement NitroxObject class
  • Implement NitroxBehavior class
  • Refactor NitroxTransform to be attached to NitroxObjects
  • Refactor Entity class to inherit NitroxBehavior
    • fix bug with entity duplication
  • Refactor EscapePodModel class to inherit NitroxBehavior
  • Refactor Vehicle classes to inherit NitroxBehavior
    • Refactor SeamothModel
    • Refactor CyclopsModel
    • Refactor ExosuitModel
  • Refactor Player class to inherit NitroxBehavior
    • Refactor player movement to use world position and local position as needed(Dont need to sync the world position of the player if he is riding in a cyclops, only need the local position)
  • Refactor Base class to inherit NitroxBehavior
    • Isolate the cause of various base related bugs

closes #1182

@killzoms killzoms force-pushed the refactorForObjects branch 2 times, most recently from c5b8f62 to 69e68e1 Compare August 9, 2020 04:05
Copy link
Collaborator

@Coding-Hen Coding-Hen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few additions/suggestions

NitroxModel/DataStructures/GameLogic/AbsoluteEntityCell.cs Outdated Show resolved Hide resolved
@@ -22,7 +22,8 @@ public static bool Prefix(ExosuitClawArm __instance)
if (pickupable != null && pickupable.isPickupable && componentInParent.storageContainer.container.HasRoomFor(pickupable))
{
NitroxServiceLocator.LocateService<Item>().PickedUp(pickupable.gameObject, pickupable.GetTechType());
} else if(component != null)
}
else if (component != null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else if (component != null)
else if (component)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is nullable, you'll need to if (component == true).

@@ -12,14 +11,20 @@ public void Prepare(Entity parentEntity, DeterministicBatchGenerator determinist
{
Entity crashFish = SpawnChild(parentEntity, deterministicBatchGenerator, TechType.Crash, "7d307502-46b7-4f86-afb0-65fe8867f893");
crashFish.Transform.LocalRotation = new NitroxQuaternion(-0.7071068f, 0, 0, 0.7071068f);
parentEntity.ChildEntities.Add(crashFish);
//parentEntity.ChildEntities.Add(crashFish);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this can be removed then

NitroxServer/GameLogic/Entities/EntityManager.cs Outdated Show resolved Hide resolved
Co-authored-by: Coding-Hen <drhen123@googlemail.com>
@Jannify Jannify removed their assignment Jan 8, 2021
@killzoms killzoms closed this Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Server] Refactor for NitroxObject implementation
5 participants