From 5ccf833981226dbd3c4517f3298bd217b726482c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 16 Aug 2023 15:04:52 -0400 Subject: [PATCH] Casting cleanup in constructor signature. --- .../net/client/handlers/PetitionReceivedMsgHandler.java | 2 +- src/engine/objects/Petition.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java b/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java index 7049bd88..e53bcc8d 100644 --- a/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java +++ b/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java @@ -37,7 +37,7 @@ public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler { if (playerCharacter == null) return true; - Petition petition = new Petition(msg, origin); + Petition petition = new Petition(petitionReceivedMsg, origin); // Write petition to database diff --git a/src/engine/objects/Petition.java b/src/engine/objects/Petition.java index 3614760b..fb8fe046 100644 --- a/src/engine/objects/Petition.java +++ b/src/engine/objects/Petition.java @@ -9,7 +9,6 @@ package engine.objects; import engine.math.Vector3fImmutable; import engine.net.client.ClientConnection; -import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.PetitionReceivedMsg; public class Petition { @@ -20,13 +19,13 @@ public class Petition { public Vector3fImmutable playerLocation; public String message; - public Petition(ClientNetMsg msg, ClientConnection origin) { - this.primaryType = ((PetitionReceivedMsg) msg).type; - this.subType = ((PetitionReceivedMsg) msg).subType; + public Petition(PetitionReceivedMsg petitionReceivedMsg, ClientConnection origin) { + this.primaryType = petitionReceivedMsg.type; + this.subType = petitionReceivedMsg.subType; this.reportAccount = origin.getAccount(); this.reportPlayer = origin.getPlayerCharacter(); this.playerLocation = origin.getPlayerCharacter().getLoc(); - this.message = ((PetitionReceivedMsg) msg).message; + this.message = petitionReceivedMsg.message; } }