Package networking.request

Source Code of networking.request.RequestUpdateGameScaleVote

package networking.request;

import java.io.IOException;

import networking.response.ResponseUpdateGameScaleVote;
import utility.DataReader;
import worldManager.gameEngine.GameEngine;

/**
*
* @author Xuyuan
*/
public class RequestUpdateGameScaleVote extends GameRequest {

    // Data
    private short avatarID;
    private short vote;
    // Responses
    private ResponseUpdateGameScaleVote responseUpdateGameScaleVote;

    public RequestUpdateGameScaleVote() {
        responses.add(responseUpdateGameScaleVote = new ResponseUpdateGameScaleVote());
    }

    @Override
    public void parse() throws IOException {
        avatarID = DataReader.readShort(dataInput);
        vote = DataReader.readShort(dataInput);
    }

    @Override
    public void doBusiness() throws Exception {
        GameEngine gameEngine = client.getWorld().getGameEngine();

        if (gameEngine != null) {
            gameEngine.run();
            gameEngine.updateGameScaleVote(avatarID, vote);
        }
    }
}
TOP

Related Classes of networking.request.RequestUpdateGameScaleVote

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.