Ejemplo n.º 1
0
        public void FlushBuffer(MutableView view)
        {
            foreach (var bufferedCommand in bufferedCommands)
            {
                switch (bufferedCommand.CommandType)
                {
                case CommandType.AddComponent:
                    view.SetComponentObject(bufferedCommand.Entity,
                                            bufferedCommand.ComponentType,
                                            bufferedCommand.ComponentObj);
                    break;

                case CommandType.RemoveComponent:
                    view.RemoveComponent(bufferedCommand.Entity,
                                         bufferedCommand.ComponentType);
                    break;

                default:
                    view.LogDispatcher.HandleLog(LogType.Error, new LogEvent(UnknownErrorEncountered)
                                                 .WithField(LoggingUtils.LoggerName, LoggerName)
                                                 .WithField("CommandType", bufferedCommand.CommandType));
                    break;
                }
            }

            bufferedCommands.Clear();
        }