Exemplo n.º 1
0
    public static worldObject placeInstance(worldObject proto, tile baseTile)
    {
        worldObject obj = new worldObject();

        obj.objectType   = proto.objectType;
        obj.movementCost = proto.movementCost;
        obj.width        = proto.width;
        obj.height       = proto.height;
        obj.baseType     = proto.baseType;
        obj.baseTile     = baseTile;
        obj.flags        = 0;

        // TODO maybe we can have multiple tile objects?
        if (!baseTile.placeObject(obj))
        {
            // the placement failed
            return(null);
        }
        return(obj);
    }