parent->layout()->addWidget(theLabel);
}
+
+bool Player::hasName() {
+ return !name.isNull();
+}
+
+QString Player::getName() {
+ return name;
+}
+
+QString Player::getCurrentLine() {
+ return currentLine;
+}
+
+void Player::resetText() {
+ currentLine.clear();
+ theLabel->setText(currentLine);
+}
+
void Player::handleKey(QString str) {
if (str.length() == 1) {
currentLine += str;
- } else if (name.isNull() && str == "Return") {
+ } else if (!hasName() && str == "Return") {
// set name
name = currentLine;
currentLine = "";