Пример #1
0
        public void consume(Command command)
        {
            if (command.isComposite())
            {
                List<Command> commands = command.getCommands();
                foreach (Command newCommand in commands)
                {

                    int schemaId = (int)newCommand.GetSchemaId();
                    List<Core> list = null;
                    coreMap.TryGetValue(schemaId, out list);
                    if (list != null)
                    {
                        foreach (Core core in list)
                        {
                            core.consume(newCommand);
                        }
                    }

                }
            }
            if (command.isCoreCommand())
            {
                int schemaId = (int)command.GetSchemaId();
                List<Core> list = coreMap[schemaId];
                if (list != null)
                {
                    foreach (Core core in list)
                    {
                        core.consume(command);
                    }
                }
            }
        }