Terentyev / SmallWorld

Board game "Small world"
6 stars 2 forks source link

Game state для защиты и в целом совместимости #19

Open Terentyev opened 12 years ago

Terentyev commented 12 years ago

{ "gameState":{ "map":{ "picture": "maps/map1.jpg", "turnsNum": 10, "mapId": 1, "mapName": "map1", "regions":[], "playersNum": 2, "thumbnail":"maps/map1Thumb.jpg"} , "gameId": 1, "currentTurn": 5, "players":[ { "inGame": true, "isReady": true, "tokensInHand": 0, "name": "user", "coins": 40, "priority": 1, "currentTokenBadge":{ "raceName": "Skeletons", "tokenBadgeId": 8, "specialPowerName": "Underworld", "totalTokensNum":12} , "declinedTokenBadge":{ "raceName": "Orcs", "tokenBadgeId": 6, "specialPowerName": "Pillaging", "totalTokensNum":5} , "id":1} , { "inGame": true, "isReady": true, "tokensInHand": 1, "name": "user1", "coins": 31, "priority": 2, "currentTokenBadge":{ "raceName": "Trolls", "tokenBadgeId": 1, "specialPowerName": "DragonMaster", "totalTokensNum":10} , "id":2} ], "gameName": "1", "visibleTokenBadges":[ { "position": 0, "raceName": "Humans", "specialPowerName": "Mounted", "bonusMoney":0} , { "position": 1, "raceName": "Tritons", "specialPowerName": "Wealthy", "bonusMoney":1} , { "position": 2, "raceName": "Elves", "specialPowerName": "Bivouacking", "bonusMoney":2} , { "position": 3, "raceName": "Dwarves", "specialPowerName": "Swamp", "bonusMoney":2} , { "position": 4, "raceName": "Giants", "specialPowerName": "Diplomat", "bonusMoney":2} , { "position": 5, "raceName": "Ratmen", "specialPowerName": "Fortified", "bonusMoney":2} ], "lastEvent": 6, "state": 0, "gameDescription": "", "activePlayerId": 2, "dragonAttacked": false, "defendingInfo":{ "playerId": 1, "regionId": 14, "tokensNum":1} } , "result":"ok"}

Вот так выглядит пример gameState'а у Лены... В первую очередь интересует /game/defendingInfo/*

pnazarov commented 12 years ago

добавлено: defendingInfo {"playerId": int, "regionId": int, "tokensNum":int}, в руки игроку ничего не добавляется

friendInfo {"diplomattId": int, "friendId": int } id - игроков dragonAttacked 0/1 - атаковали ли драконом на этом ходу enchanted 0/1 - зачаровывали ли на этом ходу gotWealthy 0/1 - получили ли мы уже бонус Wealthy holesPlaced int - количество уже поставленных нор stoutStitistics массив как в ответе finishTurn berserkerDice undef/int - undef если не бросали на этом ходу