| 1888 | } |
| 1889 | |
| 1890 | int Seat::readTilesVisualInitialStates(TileVisual tileVisual, std::istream& is) |
| 1891 | { |
| 1892 | // We check if it is the Seat end tag |
| 1893 | std::string str; |
| 1894 | OD_ASSERT_TRUE(is >> str); |
| 1895 | if (str == "[/Seat]") |
| 1896 | return 0; |
| 1897 | |
| 1898 | if(str != "[" + Tile::tileVisualToString(tileVisual) + "]") |
| 1899 | { |
| 1900 | OD_LOG_INF("WARNING: expected [" + Tile::tileVisualToString(tileVisual) + "] and read " + str); |
| 1901 | return -1; |
| 1902 | } |
| 1903 | |
| 1904 | |
| 1905 | while(true) |
| 1906 | { |
| 1907 | OD_ASSERT_TRUE(is >> str); |
| 1908 | if(str == "[/" + Tile::tileVisualToString(tileVisual) + "]") |
| 1909 | break; |
| 1910 | |
| 1911 | std::pair<int, int> tilecoords; |
| 1912 | tilecoords.first = Helper::toInt(str); |
| 1913 | |
| 1914 | OD_ASSERT_TRUE(is >> str); |
| 1915 | tilecoords.second = Helper::toInt(str); |
| 1916 | |
| 1917 | int seatId; |
| 1918 | OD_ASSERT_TRUE(is >> seatId); |
| 1919 | |
| 1920 | TileStateNotified& tileState = mTilesStateLoaded[tilecoords]; |
| 1921 | tileState.mTileVisual = tileVisual; |
| 1922 | tileState.mSeatIdOwner = seatId; |
| 1923 | } |
| 1924 | |
| 1925 | return 1; |
| 1926 | } |
| 1927 | |
| 1928 | void Seat::setPlayerSettings(bool koCreatures) |
| 1929 | { |