Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
+69 -69
View File
@@ -22,83 +22,83 @@ import java.util.ArrayList;
public class LoadStructureMsg extends ClientNetMsg {
private ArrayList<Building> structureList;
private ArrayList<Building> structureList;
/**
* This is the general purpose constructor.
*/
public LoadStructureMsg() {
this(new ArrayList<>());
}
/**
* This is the general purpose constructor.
*/
public LoadStructureMsg() {
this(new ArrayList<>());
}
/**
* This is the general purpose constructor.
*
* @param structures
*/
public LoadStructureMsg(ArrayList<Building> structures) {
super(Protocol.LOADSTRUCTURE);
this.structureList = structures;
}
/**
* This is the general purpose constructor.
*
* @param structures
*/
public LoadStructureMsg(ArrayList<Building> structures) {
super(Protocol.LOADSTRUCTURE);
this.structureList = structures;
}
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the
* ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public LoadStructureMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.LOADSTRUCTURE, origin, reader);
}
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the
* ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public LoadStructureMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.LOADSTRUCTURE, origin, reader);
}
/**
* @see AbstractNetMsg#getPowerOfTwoBufferSize()
*/
@Override
protected int getPowerOfTwoBufferSize() {
//Larger size for historically larger opcodes
return (18); // 2^16 == 64k
}
/**
* @see AbstractNetMsg#getPowerOfTwoBufferSize()
*/
@Override
protected int getPowerOfTwoBufferSize() {
//Larger size for historically larger opcodes
return (18); // 2^16 == 64k
}
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) {
for (int i = 0; i < 4; i++)
writer.putInt(0);
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) {
for (int i = 0; i < 4; i++)
writer.putInt(0);
writer.putInt(this.structureList.size());
for (Building building:this.structureList){
Building._serializeForClientMsg(building, writer);
}
writer.putInt(0);
}
writer.putInt(this.structureList.size());
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
reader.getInt();
reader.getInt();
reader.getInt();
reader.getInt();
int size = reader.getInt();
// TODO finish Deserialize impl
}
for (Building building : this.structureList) {
Building._serializeForClientMsg(building, writer);
}
writer.putInt(0);
}
// TODO fix ArrayList Accessability.
public ArrayList<Building> getStructureList() {
return this.structureList;
}
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
reader.getInt();
reader.getInt();
reader.getInt();
reader.getInt();
int size = reader.getInt();
// TODO finish Deserialize impl
}
public void addObject(Building obj) {
this.structureList.add(obj);
}
// TODO fix ArrayList Accessability.
public ArrayList<Building> getStructureList() {
return this.structureList;
}
public int size() {
return this.structureList.size();
}
public void addObject(Building obj) {
this.structureList.add(obj);
}
public int size() {
return this.structureList.size();
}
}