/******************************* FILE HEADER **********************************
    Program:          Tic Tac Toe, version 1
    File:             Mark.java
    Main File:        TicTacToe1.java
    
    Author:           James D. Skrentny
                      copyright 2000, all rights reserved
    Course:           CS 302, Fall 2000, Lectures 1 & 2
    
    Compiler:         CodeWarrior IDE 4.0 (JDK 1.2)
    Platform:         Windows NT 4.0
 **************************** 80 columns wide *********************************/

/**
 * The Mark class represents a player's mark, which is assumed to be a single
 * character, and is used to mark the board for the game Tic Tac Toe.
 *
 * Bugs: none known
 **/
 
/*
 * The following concepts are illustrated:
 *     - a simple constructor
 *     - equals test
 *     - toString coversion
 */

public class Mark {

    private String mark;
        
    /**         
    * Constructs a Mark object using the first character of the specified String.
    * @param specifiedString the character for the mark
    **/
    public Mark (String specifiedString) {
        mark = new String(specifiedString.substring(0, 1));
    }
            
    /**         
    * Determines if a mark is equal to the compareMark.
    * @return returns true if this mark and compareMark are the same,
    * otherwise false is returned
    **/
    public boolean equals (Mark compareMark) {
        return mark.equals(compareMark.mark);
    }
    
    /**         
    * Returns the mark as a String object.
    * @return the mark as a String
    **/
    public String toString () {
        return mark;
    }
    
}
