head	1.5;
access;
symbols
	tonic_4:1.5
	tonic_3:1.5
	tonic_2:1.5
	demo:1.5.0.2
	design_report:1.4;
locks; strict;
comment	@ * @;


1.5
date	95.12.12.23.29.30;	author hartmans;	state Exp;
branches;
next	1.4;

1.4
date	95.12.04.03.26.54;	author daveg;	state Exp;
branches;
next	1.3;

1.3
date	95.12.03.09.52.36;	author daveg;	state Exp;
branches;
next	1.2;

1.2
date	95.12.03.05.00.42;	author hartmans;	state Exp;
branches;
next	1.1;

1.1
date	95.12.02.12.00.45;	author daveg;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Change prototypes for player::display
@
text
@//  This is -*- c++ -*- code

#ifndef __HUMAN_PLAYER_H__
#define __HUMAN_PLAYER_H__

#include <6170.h>
#include "board.h"
#include "player.h"
#include "top_node.h"
class move;

class http_response;

class human_player : public player {
    // Overview: A human_player is an interface for a human to play a
    // game on a board.
public:
    // Constructors:

    human_player(string name, long time_in_msecs, top_node *tnode, bool
		 start_detached);
    // Checks: total_time >= 0;
    // Effects:  Creates a new human_player, not associated with
    // any game which will have have up total_time seconds to complete
    // all moves, the given name, and in a detached state if
    // start_detached is true.  The given top_node is stored for later
    // possible interactions.. Assigns a name to the new
    // human_player.

    // Methods:
    virtual void detach();
    // Requires: this be attached
    // Modifies: this, top
    // Effects: Detaches this and adds the game, player touple to the top
    // node so another can connect.

    virtual void attach(string name);
    // Requires: this not be attached. 
    // Modifies: this, top
    // Effects: Attaches this, notifies the top_node
    // that it is associated with, and sets name as given.
    
    virtual void display(extensions *ext, ostream &body, int point_of_view) const;

    virtual void you_moved(move &m);

    virtual void opponent_moved (move &m, int p);

    virtual void state_changed(void);

    bool is_attached() const;
    // Effects: returns true if this is attached else returns false.
    
    http_response *human_player::get (string request, extensions *ext);
    
protected:
    virtual void associate(game *g);
    
private:

    human_player();
    // Disable default constructor

    void operator= (human_player &);
    // Disable equality operator

    bool attached;
    // Am I attached to a game?
    int my_index;
    // My player index

    top_node *top;
    // The top node that this is associated with
};

inline bool human_player::is_attached() const {
    return attached;
}

#endif
@


1.4
log
@bug fixes
@
text
@d43 1
a43 1
    virtual void display(extensions *ext, ostream &body) const;
@


1.3
log
@minor details
@
text
@d9 1
d54 2
d76 3
a78 1
inline bool human_player::is_attached() const {return attached};
@


1.2
log
@Tidy up human_player,
implement machine_player::get

clarify associate specs.
@
text
@d24 4
a27 2
    // all moves. Assigns a name to the new human_player. Sets
    // my_index to this player's player index.
d49 1
@


1.1
log
@created file
@
text
@d18 1
d29 1
a29 1
    // Requires: this be attached to a game.
d31 2
a32 2
    // Effects: Detaches this from their current game, and notifies the
    // top_node that it is associated with.
d34 2
a35 2
    virtual void attach(string name, game *new_game);
    // Requires: this not be attached to a game.
d37 1
a37 1
    // Effects: Attaches this to the given game, notifies the top_node
d47 3
a49 1

a53 2
    void try_move(void);
    // Try to make a move now.
d70 2
@
