netwar.game
Interface GameViewer

All Known Implementing Classes:
HexViewer

public interface GameViewer

Interface for an object capable of displaying the contents of a game, which are instances of Hex, GameObject and Projectile.

Author:
Group N2 - Project Netwar, Daniel Grund

Method Summary
 void drawImage(Point3D vr, java.awt.Image img)
          This method draws an image on the GameViewer's display.
 void drawLine(Point3D v1, Point3D v2)
          This method draws a line segment on the GameViewer's display.
 void drawTriangle(Point3D v1, Point3D v2, Point3D v3)
          This method draws a filled triangle on the GameViewer's display.
 void setColor(java.awt.Color c)
          This method sets the color for subsequent calls to drawLine and drawTriangle.
 

Method Detail

setColor

public void setColor(java.awt.Color c)
This method sets the color for subsequent calls to drawLine and drawTriangle.
Parameters:
c - The color which subsequent render calls will be drawn in.

drawLine

public void drawLine(Point3D v1,
                     Point3D v2)
This method draws a line segment on the GameViewer's display. The line segment is drawn from the pixel containing v1 to the pixel containing v2.
Parameters:
v1 - One end of the line in game-space
v2 - The other end of the line in game-space

drawTriangle

public void drawTriangle(Point3D v1,
                         Point3D v2,
                         Point3D v3)
This method draws a filled triangle on the GameViewer's display. The vertices are the pixels containing v1, v2, and v3.
Parameters:
v1 - One vertice in game-space.
v2 - A second vertice in game-space.
v3 - The third vertice in game-space.

drawImage

public void drawImage(Point3D vr,
                      java.awt.Image img)
This method draws an image on the GameViewer's display.
Parameters:
vr - The point in game-space located at the center of where the image should appear.
img - The Image to display.