from core.helper import enum

from siege import game
from siege.io import DataStream
from siege.network import Message


PlayerReserveChanges = enum("Resize", "Restore")


class ClientAssist(object):
    @staticmethod
    def requestReserveCreation(name, size):
        packet = DataStream(Message.PLAYER_RESERVE)
        packet.writeUint8(PlayerReserveChanges.Resize)
        packet.writeString(name)
        packet.writeUint8(size)
        game.network.getClient().send(packet)

    @staticmethod
    def requestReserveRestoration(name):
        packet = DataStream(Message.PLAYER_RESERVE)
        packet.writeUint8(PlayerReserveChanges.Restore)
        packet.writeString(name)
        game.network.getClient().send(packet)
