void Level::globalMessage(Vec2 position, const PlayerMessage& ifPlayerCanSee, const PlayerMessage& cannot) const { if (player) { if (playerCanSee(position)) player->playerMessage(ifPlayerCanSee); else if (player->getPosition().dist8(position) < hearingRange) player->playerMessage(cannot); } }
void Level::globalMessage(Vec2 position, const string& ifPlayerCanSee, const string& cannot) const { if (player) { if (playerCanSee(position)) player->privateMessage(ifPlayerCanSee); else if (player->getPosition().dist8(position) < 30) player->privateMessage(cannot); } }