players = {
player1: {
currentpos: 0,
prevpos: 0,
startpos: 0,
balance: 1500
},
player2: {
currentpos: 0,
prevpos: 0,
startpos: 0,
balance: 1500
}
};
positions = {
position1: {
title: "Cairo",
type: "brown",
owner: "unowned",
purchaseprice: 60,
rentprice: 2,
forsale: "y"
},
position2: {
title: "Schiphol Airport",
type: "airport",
owner: "unowned",
purchaseprice: 200,
rentprice: 25,
forsale: "y"
},
position3: {
title: "Vienna",
type: "brown",
owner: "unowned",
purchaseprice: 60,
rentprice: 4,
forsale: "y"
},
position6: {
title: "Brussels",
type: "blue",
owner: "unowned",
purchaseprice: 100,
rentprice: 6,
forsale: "y"
}
};
I want to know if a player owns a set. For instance 2 browns makes a set. It takes 3 blues to make a set. A player could own more than 1 sets. He could own 2 browns and 3 blues and thus the blue set and the brown set. Owning a set determines whether a player can build properties. At the momement when a player buys a position I just update the "owner" value from "unowned" to "playername". What properties should I add to help establish whether a player owns a set.