2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.messages.outgoing;
|
|
|
|
|
|
|
|
import com.eu.habbo.messages.ServerMessage;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public abstract class MessageComposer {
|
2020-05-09 21:29:49 +02:00
|
|
|
|
|
|
|
private ServerMessage composed;
|
2018-07-06 15:30:00 +02:00
|
|
|
protected final ServerMessage response;
|
2019-05-26 20:14:53 +02:00
|
|
|
|
|
|
|
protected MessageComposer() {
|
2020-05-09 21:29:49 +02:00
|
|
|
this.composed = null;
|
2018-07-06 15:30:00 +02:00
|
|
|
this.response = new ServerMessage();
|
|
|
|
}
|
2019-05-26 20:14:53 +02:00
|
|
|
|
2020-05-09 21:29:49 +02:00
|
|
|
protected abstract ServerMessage composeInternal();
|
|
|
|
|
|
|
|
public ServerMessage compose() {
|
|
|
|
if (this.composed == null) {
|
|
|
|
this.composed = this.composeInternal();
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.composed;
|
|
|
|
}
|
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|