Package networking.request

Source Code of networking.request.RequestShopListPlant

package networking.request;

import core.GameServer;

import dataAccessLayer.ShopDAO;

import java.io.IOException;
import java.util.List;

import model.PlantType;

import networking.response.ResponseShopListPlant;

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

    // Responses
    private ResponseShopListPlant responseShopListPlant;

    public RequestShopListPlant() {
        responses.add(responseShopListPlant = new ResponseShopListPlant());
    }

    @Override
    public void parse() throws IOException {
        //Do Nothing here.
    }

    @Override
    public void doBusiness() throws Exception {
        List<PlantType> plantList = ShopDAO.getPlantsUpToLevel(client.getAvatar().getLevel());
//        plantList.addAll(GameServer.getInstance().getPlantTypes());
        responseShopListPlant.setAllPlantType(plantList);
    }
}
TOP

Related Classes of networking.request.RequestShopListPlant

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.