public bool buyLocation(Player buyer) { if (!buyer.MoneyDepositIsPositive(-Tilecost) || owner != null) { return(false); } buyer.addLandToOwned(this); buyer.MoneyChange(-Tilecost); this.owner = buyer; this.tileStatus = TILE_STATUS.OWNED_LAND; return(true); }
void Awake() { // tileImageInfo. tileStatus = TILE_STATUS.UNOWNED_LAND; // assign the offsets to each player PlayerslocationsOffsets = new Vector3[4]; PlayerslocationsOffsets[0] = new Vector3(-0.75f, 0.45f, 0.75f); PlayerslocationsOffsets[1] = new Vector3(0.7f, 0.45f, -0.7f); PlayerslocationsOffsets[2] = new Vector3(0.75f, 0.45f, 0.75f); PlayerslocationsOffsets[3] = new Vector3(-0.7f, 0.45f, -0.7f); // add the global position of the tile to the offsets PlayersLocations = new Vector3[4]; for (int i = 0; i < playersNo; i++) { PlayersLocations[i] = transform.position + Vector3.up * PlayerslocationsOffsets[i].y + Vector3.right * PlayerslocationsOffsets[i].x + Vector3.forward * PlayerslocationsOffsets[i].z; } tileImageInfo = new TileImageInfo(); tileImageInfo.setValues(this.tileName, this.Tilecost, this.rentMoney); }