function visit(Unit $node) { $txt = ""; $pad = 4 * $node->getDepth(); $txt .= sprintf("%{$pad}s", ""); $txt .= get_class($node) . ": "; $txt .= "bombard: " . $node->bombardStrength() . "\n"; $this->text .= $txt; }
function visit(Unit $node) { $ret = ""; $pad = 4 * $node->getDepth(); $ret .= sprintf("%{$pad}s", ""); $ret .= get_class($node) . ": "; $ret .= "Огневая мощь: " . $node->bombardStrength() . "<br />"; $this->text .= $ret; }