Advertisement
Guest User

Untitled

a guest
Feb 7th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. //function Player(name, symbol, score, onTurn)
  3. function Player(n, s, p, b)
  4. {
  5.     var name = n;
  6.     var symbol = s;
  7.     var score = p;
  8.     var onTurn = b;
  9.  
  10.     this.getName = getName;
  11.     this.getSymbol = getSymbol;
  12.     this.getScore = getScore;
  13.     this.setScore = setScore;
  14.     this.raiseScore = raiseScore;
  15.     this.getOnTurn = getOnTurn;
  16.     this.setTurn = setOnTurn;
  17.     this.setOffTurn = setOffTurn;
  18.  
  19.     function getName()          { return name; }
  20.     function getSymbol()       { return symbol; }
  21.     function getScore()         { return score; }
  22.     function setScore(points)   { score = points; }
  23.     function raiseScore()     { score++; }
  24.     function getOnTurn()      { return turn; }
  25.     function setOnTurn()      { turn = true; }
  26.     function setOffTurn()      { turn = false;}
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement