Beispiel #1
0
        public JSONNode ToJson()
        {
            var command_group_info = new JSONObject();
            var command_ids        = new JSONArray();

            command_ids.Add(ConditionalCommand ? ConditionalCommand.ID : -1);

            foreach (var command in CommandsSequence)
            {
                if (command is SingleCommandModel)
                {
                    command_ids.Add(command.ID);
                }
                else
                {
                    command_ids.Add(command.ID * -1 - 1);
                }
            }

            command_group_info["id"]   = ID;
            command_group_info["name"] = gameObject.name;
            command_group_info["playable_entity_id"] = Playable.GetComponent <PuzzleEntityModel>().ID;
            command_group_info["command_ids"]        = command_ids;
            command_group_info["condition"]          = Condition;

            return(command_group_info);
        }
Beispiel #2
0
        public JSONNode ToJson()
        {
            var command_info = new JSONObject();

            command_info["id"]   = ID;
            command_info["name"] = gameObject.name;
            command_info["playable_entity_id"] = Playable.GetComponent <PuzzleEntityModel>().ID;
            command_info["condition"]          = Condition;

            return(command_info);
        }