package game
func processOwnedColors() {
- for _, ocv := range OwnedColorVisitors {
- visitorID := ocv.visitorID
- ownerID := ocv.ownerID
- colorID := ocv.colorID
+ for _, oCV := range OwnedColorVisitors {
+ visitorID := oCV.visitorID
+ ownerID := oCV.ownerID
+ colorID := oCV.colorID
prop := ColorProperties[colorID]
prices := ColorPropertyRents[colorID]
var Users []User
var DebtEvents []int32
-func HasMonopoly(playerID int32, targetGroup ColorGroup) bool {
+func HasColorMonopoly(playerID int32, targetGroup ColorGroup) bool {
var ownedCount int32
for colorID, ownerID := range PropertyOwners {
if ownerID == playerID && ColorProperties[colorID].GroupID == targetGroup {
return ownedCount == ColorGroupSizes[targetGroup]
}
+func HasUtiltyMonopoly(playerID int32) bool {
+ var ownedCount int32
+ for _, ownerID := range PropertyOwners {
+ if ownerID == playerID {
+ ownedCount++
+ }
+ }
+
+ return ownedCount == int32(len(UtilityProperties))
+}
+
func IsInDebt(playerID int32) (bool, int32) {
for i, pID := range DebtEvents {
if pID == playerID {
--- /dev/null
+package game
+
+func processOwnedUtility() {
+ for _, oUV := range OwnedUtilityVisitors {
+ visitorID := oUV.visitorID
+ ownerID := oUV.ownerID
+ // utilityID := oUV.utilityID
+ diceRoll := oUV.diceRoll
+
+ var rent int32 = UtilityRentMult[HasUtiltyMonopoly(ownerID)] * diceRoll
+
+ AdjustPlayerMoney(visitorID, -rent)
+ AdjustPlayerMoney(ownerID, rent)
+ }
+}