@@ -0,0 +1,3118 @@
+/*******************************************************************************%0A * Copyright (c) 2015%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the %22Software%22),%0A * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,%0A * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER%0A * DEALINGS IN THE SOFTWARE.%0A *******************************************************************************/%0Apackage jsettlers.input.tasks;%0A%0Aimport jsettlers.common.material.EMaterialType;%0Aimport jsettlers.common.position.ShortPoint2D;%0Aimport jsettlers.graphics.action.SetMaterialProductionAction;%0A%0Aimport java.io.DataInputStream;%0Aimport java.io.DataOutputStream;%0Aimport java.io.IOException;%0A%0A/**%0A * @author codingberlin%0A */%0Apublic class SetMaterialProductionGuiTask extends SimpleGuiTask %7B%0A%0A%09private float ratio;%0A%09private SetMaterialProductionAction.EMaterialProductionType productionType;%0A%09private EMaterialType materialType;%0A%09private ShortPoint2D position;%0A%0A%09public SetMaterialProductionGuiTask() %7B%7D;%0A%0A%09public SetMaterialProductionGuiTask(byte playerId, ShortPoint2D position, EMaterialType materialType, SetMaterialProductionAction%0A%09%09%09.EMaterialProductionType productionType, float ratio) %7B%0A%09%09super(EGuiAction.SET_MATERIAL_PRODUCTION, playerId);%0A%09%09this.ratio = ratio;%0A%09%09this.productionType = productionType;%0A%09%09this.materialType = materialType;%0A%09%09this.position = position;%0A%09%7D%0A%0A%09public float getRatio() %7B%0A%09%09return ratio;%0A%09%7D%0A%0A%09public SetMaterialProductionAction.EMaterialProductionType getProductionType() %7B%0A%09%09return productionType;%0A%09%7D%0A%0A%09public EMaterialType getMaterialType() %7B%0A%09%09return materialType;%0A%09%7D%0A%0A%09public ShortPoint2D getPosition() %7B%0A%09%09return position;%0A%09%7D%0A%0A%09@Override%0A%09protected void serializeTask(DataOutputStream dos) throws IOException %7B%0A%09%09super.serializeTask(dos);%0A%09%09SimpleGuiTask.serializePosition(dos, position);%0A%09%09dos.writeInt(materialType.ordinal());%0A%09%09dos.writeInt(productionType.ordinal());%0A%09%09dos.writeFloat(ratio);%0A%09%7D%0A%0A%09@Override%0A%09protected void deserializeTask(DataInputStream dis) throws IOException %7B%0A%09%09super.deserializeTask(dis);%0A%09%09position = SimpleGuiTask.deserializePosition(dis);%0A%09%09materialType = EMaterialType.values%5Bdis.readInt()%5D;%0A%09%09productionType = SetMaterialProductionAction.EMaterialProductionType.values%5Bdis.readInt()%5D;%0A%09%09ratio = dis.readFloat();%0A%09%7D%0A%7D%0A

connect toolproduction with MaterialProduction