
class Network_Multiplexer_Event_ServerUpdate extends Network_Multiplexer_Event {

	/**
	 * @param   {Model_Server} server
	 * @returns {self}
	 */
	setServer(server) {
		this.server = server;
		return this;
	}

	/**
	 * @returns {Model_Server}
	 */
	getServer() {
		return this.server;
	}

	/**
	 * @returns {object}
	 */
	toObject() {
		var object = super.toObject();

		object.server = this.getServer().redact();

		return object;
	}

}


ObjectHelper.extend(Network_Multiplexer_Event_ServerUpdate, {
	/**
	 * @param   {object} object
	 * @returns {Network_Multiplexer_Event_ServerUpdate}
	 */
	fromObject(object) {
		object.server = new Model_Server(object.server);

		return Network_Multiplexer_Event.fromObject.call(this, object);
	}
});

ObjectHelper.extend(Network_Multiplexer_Event_ServerUpdate.prototype, {
	event_type: Network_Multiplexer_Enum_EventTypes.SERVER_UPDATE,
	server:     null
});

module.exports = Network_Multiplexer_Event_ServerUpdate;
