/***********************************************************************

GECCO, a platform for command and control gaming

Copyright (C) 2001 Henrik Bäärnhielm, Andreas Enblom, Niklas
Hallenfur, Karl Hasselström, Henrik Hägerström, Oskar Linde, Jing Fu
Zi and Jon Åslund

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.

***********************************************************************/

package gecco.server.core;
import java.awt.Color;


import java.awt.Dimension;
import java.util.Map;

/**
 *  Description of the Interface
 *
 * @author     Unknown
 * @created    June 27, 2001
 */
public interface Server {
    /**
     *  Orders an action that takes no parameters.
     *
     * @param  fromRole    the role that sent the order.
     * @param  actionId    an identifier for this action.
     * @param  unitHandle  the unit being ordered.
     * @param  action      the action to perform.
     */
    public void actionOnVoid(String fromRole, long actionId,
            int unitHandle, String action);


    /**
     *  Orders an action that takes a unit as a parameter.
     *
     * @param  fromRole    the role that sent the order.
     * @param  actionId    an identifier for this action.
     * @param  unitHandle  the unit being ordered.
     * @param  action      the action to perform.
     * @param  targetUnit  the unit being targeted.
     */
    public void actionOnUnit(String fromRole, long actionId,
            int unitHandle, String action,
            int targetUnit);


    /**
     *  Orders an action that takes a position parameter.
     *
     * @param  fromRole    the role that sent the order.
     * @param  actionId    an identifier for this action.
     * @param  unitHandle  the unit being ordered.
     * @param  action      the action to perform.
     * @param  x           the X coordinate parameter.
     * @param  y           the Y coordinate parameter.
     */
    public void actionOnPosition(String fromRole, long actionId,
            int unitHandle, String action,
            double x, double y);


    /**
     *  Aborts the given action. This causes the action to fail.
     *
     * @param  fromRole  the role that sent the order.
     * @param  actionId  the action to cancel.
     */
    public void abortAction(String fromRole, long actionId);


    /**
     *  Called when a client wants all its available visible information sent
     *
     * @param  fromRole  Description of Parameter
     */
    public void startGame(String fromRole);



    /**
     *  Returns the size of the map.
     *
     * @return    A Dimension object representing the size of the map.
     */
    public Dimension getMapSize();


    /**
     *  Returns the map itself, in its original state.
     *
     * @return    A BufferedImage depicting the map.
     */
    public byte[] getMap();


    /**
     *  Returns a map with keys representing the string for each unit type. Each
     *  key maps to a byte-array containing the image data read from a
     *  .gif-image.
     *
     * @return    The Map
     */
    public Map getUnitTypeIcons();
}
