コード例 #1
0
        protected override void finish()
        {
            if (!(keyGenerator.have_value))
            {
                throw new Exception("The `BattleshipCommandKind' field is missing.");
            }
            if (!(getCommandResultJSONKey().Equals("BattleshipCommand")))
            {
                throw new Exception("The key field has a value other than `BattleshipCommand'.");
            }
            BattleshipCommandJSON result = createForKey(keyGenerator.value, unknownFieldGenerator.index);

            Debug.Assert(result != null);
            finish(result);
            int extra_count = unknownFieldGenerator.field_names.Count;

            Debug.Assert(extra_count == unknownFieldGenerator.field_values.Count);
            for (int extra_num = 0; extra_num < extra_count; ++extra_num)
            {
                result.extraBattleshipCommandAppendPair(unknownFieldGenerator.field_names[extra_num], unknownFieldGenerator.field_values[extra_num]);
            }
            unknownFieldGenerator.field_names.Clear();
            unknownFieldGenerator.field_values.Clear();
            unknownFieldGenerator.index = new Dictionary <string, JSONValue>();
            if (!allow_incomplete)
            {
                string missing_field_error = result.missing_field_error(allow_unpolished);
                if (missing_field_error != null)
                {
                    error(missing_field_error);
                }
            }
            handle_result(result);
        }
コード例 #2
0
 protected void finish(BattleshipCommandJSON result)
 {
     if (fieldGeneratorGameName.have_value)
     {
         result.setGameName(fieldGeneratorGameName.value);
         fieldGeneratorGameName.have_value = false;
     }
     base.finish(result);
 }
コード例 #3
0
 protected override void handle_result(BattleshipCommandJSON new_result)
 {
     handle_result((BattleshipDictateCoordinatesCommandJSON )new_result);
 }
コード例 #4
0
 protected override void handle_result(BattleshipCommandJSON result)
 {
     top.value.Add(result);
 }
コード例 #5
0
        protected override void handle_result(BattleshipCommandJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
コード例 #6
0
 protected abstract void handle_result(BattleshipCommandJSON new_result);
コード例 #7
0
 protected override void handle_result(BattleshipCommandJSON new_result)
   {
     handle_result((BattleshipPlayCommandJSON )new_result);
   }
コード例 #8
0
 protected override void handle_result(BattleshipCommandJSON new_result)
 {
     handle_result((BattleshipNotUnderstoodCommandJSON )new_result);
 }