修订版 | 67 (tree) |
---|---|
时间 | 2011-05-22 15:19:03 |
作者 | (del#42492) |
単純な計算機のサンプルを通して、プロパティのバグを発見し、修正した。
@@ -66,15 +66,15 @@ | ||
66 | 66 | |
67 | 67 | class CalculatorView : public DefaultView { |
68 | 68 | void start(Context& context) { |
69 | - cout << "start"; | |
69 | + cout << "start" << endl; | |
70 | 70 | } |
71 | 71 | |
72 | 72 | void soundStarted(Context& context) { |
73 | - cout << "soundStarted"; | |
73 | + cout << "soundStarted" << endl; | |
74 | 74 | } |
75 | 75 | |
76 | 76 | void soundStoped(Context& context) { |
77 | - cout << "soundStoped"; | |
77 | + cout << "soundStoped" << endl; | |
78 | 78 | } |
79 | 79 | |
80 | 80 | void recognized(Context& context, Recognition& recognition) { |
@@ -92,6 +92,7 @@ | ||
92 | 92 | } else if (op == "/") { |
93 | 93 | cout << (double(number1) / double(number2)); |
94 | 94 | } |
95 | + cout << endl; | |
95 | 96 | } |
96 | 97 | }; |
97 | 98 |
@@ -92,13 +92,13 @@ | ||
92 | 92 | phrase_(phrase->getPhrase()) { |
93 | 93 | if (phrase->hasProperty()) { |
94 | 94 | if (phrase->hasPropertyInt() && phrase->hasPropertyString()) { |
95 | - property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPhrase(), phrase->getPropertyInt(), phrase->getPropertyString())); | |
95 | + property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPropertyName(), phrase->getPropertyInt(), phrase->getPropertyString())); | |
96 | 96 | } else if (phrase->hasPropertyInt()) { |
97 | - property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPhrase(), phrase->getPropertyInt())); | |
97 | + property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPropertyName(), phrase->getPropertyInt())); | |
98 | 98 | } else if (phrase->hasPropertyString()) { |
99 | - property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPhrase(), phrase->getPropertyString())); | |
99 | + property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPropertyName(), phrase->getPropertyString())); | |
100 | 100 | } else { |
101 | - property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPhrase())); | |
101 | + property_ = PhrasePropertyPtr(new PhraseProperty(phrase->getPropertyName())); | |
102 | 102 | } |
103 | 103 | } |
104 | 104 | } |