Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 105 lines (71 sloc) 1.638 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
//
// This defines the Node class. Used as a Node of the graph
//
// Created by Zo Obradovic on 2/1/12.
//

#ifndef QUORA_NODE_H
#define QUORA_NODE_H

// includes
#include <iostream>
#include <sstream>
#include <vector>



class Node
{
    
  public:
    
    //
    // CLASS CONSTANTS
    //
    typedef enum
    {
        OURS = 0,
        THEIRS = 1,
        START = 2,
        STOP = 3
    }
    Value;
     
    
    
    //
    // OBJECT ACCESSORS
    //
    int x () const;
    int y () const;
    Value value () const;
    int id () const;

    
    //
    // OBJECT ATTRIBUTES
    //
    bool isVisited () const;
    bool isOurs () const;
    bool isTheirs () const;
    bool isStart () const;
    bool isStop () const;
    
    
    //
    // OBJECT MUTATORS
    //
    void setVisited (bool);
    void setId (int);
    void x (int);
    void y (int);

    
    
    //
    // BOOKKEEPERS
    //
    Node ();
    Node (int, int, int, int); // x, y, value, id
    Node (const Node &);
    ~Node ();
    
    
    
    
  protected:
    
    
    // Bookkeeper helpers
    void _zero (); // zero's out values, pointers, etc
    void _initialize (int, int, int, int); // initializes state to the passed-in values
    

    // say hello to my little friend
    friend std::ostream & operator << (std::ostream &, const Node &);
    
  
    
    
  private:
    
    //
    // PRIVATE MEMBERS
    //
    int myX;
    int myY;
    Value myValue;
    bool myVisited;
    int myId;

};



#endif
Something went wrong with that request. Please try again.