//
// $Id: Tile.java,v 1.15 2001/10/12 00:38:15 shaper Exp $

package com.threerings.media.tile;

import java.awt.*;

/**
 * A tile represents a single square in a single layer in a scene.
 */
public class Tile
{
    /** The tile image. */
    public Image img;

    /** The tile set identifier. */
    public short tsid;

    /** The tile identifier within the set. */
    public short tid;

    /** The tile width in pixels. */
    public short width;

    /** The tile height in pixels. */
    public short height;

    /**
     * Construct a new tile with the specified identifiers.  Intended
     * only for use by the <code>TileSet</code>.  Do not call this
     * method.
     *
     * @see TileSet#getTile
     */
    public Tile (int tsid, int tid)
    {
	this.tsid = (short) tsid;
	this.tid = (short) tid;
    }

    /**
     * Returns the fully qualified tile id for this tile. The fully
     * qualified id contains both the tile set identifier and the tile
     * identifier.
     */
    public int getTileId ()
    {
        return ((int)tsid << 16) | tid;
    }

    /**
     * Render the tile image at the top-left corner of the given shape
     * in the given graphics context.
     */
    public void paint (Graphics2D gfx, Shape dest)
    {
	Rectangle bounds = dest.getBounds();
	gfx.drawImage(img, bounds.x, bounds.y, null);
    }

    /**
     * Return a string representation of the tile information.
     */
    public String toString ()
    {
	StringBuffer buf = new StringBuffer();
	buf.append("[tsid=").append(tsid);
	buf.append(", tid=").append(tid);
	buf.append(", img=").append(img);
	return buf.append("]").toString();
    }
}

@@ -19,17 +19,17 @@
 va,v 1.1
-5
+6
  2001/10
@@ -33,18 +33,18 @@
 /10/
-12 00:38:1
+22 18:11:2
 5 sh
@@ -1575,43 +1575,8 @@
 d);%0A
-%09buf.append(%22, img=%22).append(img);%0A
 %09ret

Removed image from toString().