Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. //My drunk class
  2. class Drunk
  3. {
  4.   public:
  5.     //constructor
  6.     //PRE: valid, initilized turf is passed
  7.     //POST: creates a drunk, obviously
  8.     Drunk( Home_Turf&, string, float, coord );
  9.    
  10.     friend ostream& operator<<( ostream& lhs, Drunk& rhs );
  11.    
  12.   private:
  13.     string name;
  14.     Home_Turf turf;
  15.     float bac;
  16.     coord location;
  17. };
  18.  
  19. //My constructor
  20. Drunk::Drunk( Home_Turf& a_turf, string a_name, float a_bac, coord a_location )
  21. {
  22.   turf = a_turf;
  23.   name = a_name;
  24.   bac = a_bac;
  25.   location = a_location;
  26.  
  27.   //put us at the starting location (hax)
  28.   turf.world[ location.x ][ location.y ] = BARNEY;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement