Beispiel #1
0
            internal override void InitializeEvent(IEventPlugin plugin, EventManager.EventConfig config)
            {
                flagRespawnTime = config.GetParameter <int>("flagRespawnTimer");

                base.InitializeEvent(plugin, config);

                TeamAFlag = FlagController.Create(this, EventManager.Team.A, _spawnSelectorA.ReserveSpawnPoint(0));
                TeamBFlag = FlagController.Create(this, EventManager.Team.B, _spawnSelectorB.ReserveSpawnPoint(0));
            }
Beispiel #2
0
        private void NewEvent(PluginInfo pluginInfo)
        {
            IEventPlugin  plugin = WorkflowManager.Instance.GetEventPlugin(pluginInfo.Class);
            WorkFlowEvent event_ = plugin.CreateEvent();

            event_.Parent     = CurrentWorkFlow;
            event_.Instance   = plugin;
            event_.PluginInfo = pluginInfo;
            event_.Name       = pluginInfo.Name;
            CurrentWorkFlow.Events.Add(event_);
            SelectedEvent = event_;
        }
Beispiel #3
0
            internal override void InitializeEvent(IEventPlugin plugin, EventManager.EventConfig config)
            {
                playerLives    = config.GetParameter <int>("playerLives");
                rounds         = config.GetParameter <int>("rounds");
                maxHelicopters = config.GetParameter <int>("maxHelicopters");
                heliHealth     = config.GetParameter <int>("heliHealth");
                damageScaler   = config.GetParameter <float>("damageScaler");

                eventHelicopters = Facepunch.Pool.GetList <EventHelicopter>();
                winners          = Facepunch.Pool.GetList <EventManager.BaseEventPlayer>();

                base.InitializeEvent(plugin, config);
            }
Beispiel #4
0
            internal override void InitializeEvent(IEventPlugin plugin, EventManager.EventConfig config)
            {
                string downgradeShortname = config.GetParameter <string>("downgradeWeapon");

                if (!string.IsNullOrEmpty(downgradeShortname))
                {
                    downgradeWeapon = ItemManager.FindItemDefinition(downgradeShortname);
                }

                weaponSet = GetWeaponSet(config.GetParameter <string>("weaponSet"));

                base.InitializeEvent(plugin, config);
            }
Beispiel #5
0
            internal override void InitializeEvent(IEventPlugin plugin, EventManager.EventConfig config)
            {
                torchItem     = ItemManager.FindItemDefinition(config.GetParameter <string>("torchItem"));
                slasherWeapon = ItemManager.FindItemDefinition(config.GetParameter <string>("slasherWeapon"));

                slasherKit = config.GetParameter <string>("slasherClothing");

                slasherTime = config.GetParameter <int>("slasherTime");
                playerTime  = config.GetParameter <int>("playerTime");

                remainingSlashers = Facepunch.Pool.GetList <EventManager.BaseEventPlayer>();

                base.InitializeEvent(plugin, config);
            }
        public WorkFlow Load(Stream myFileStream)
        {
            XmlSerializer mySerializer =
                new XmlSerializer(typeof(WorkFlow));
            WorkFlow flow = (WorkFlow)mySerializer.Deserialize(myFileStream);

            WorkFlow resflow = Instance.CreateWorkFlow();

            resflow.Id          = flow.Id;
            resflow.Name        = flow.Name;
            resflow.Description = flow.Description;
            resflow.Version     = flow.Version;
            resflow.Properties.CopyValuesFrom(flow.Properties);

            foreach (Variable variable in flow.Variables.Items)
            {
                if (resflow.Variables[variable.Name] != null)
                {
                    resflow.Variables[variable.Name].Value = variable.Value;
                }
                else
                {
                    resflow.Variables.Items.Add(variable);
                }
            }

            foreach (var flowEvent in flow.Events)
            {
                IEventPlugin plugin = Instance.GetEventPlugin(flowEvent.PluginInfo.Class);

                WorkFlowEvent event_ = plugin.CreateEvent();
                event_.Parent     = resflow;
                event_.Instance   = plugin;
                event_.PluginInfo = flowEvent.PluginInfo;
                event_.Name       = flowEvent.Name;
                event_.Properties.CopyValuesFrom(flowEvent.Properties);
                LoadPluginInfo(event_.PluginInfo);

                foreach (var flowCommand in flowEvent.CommandCollection.Items)
                {
                    IWorkflowCommand commandPlugin = Instance.GetCommandPlugin(flowCommand.PluginInfo.Class);
                    var wCommand = commandPlugin.CreateCommand();
                    wCommand.Instance   = commandPlugin;
                    wCommand.PluginInfo = flowCommand.PluginInfo;
                    wCommand.Name       = flowCommand.Name;
                    wCommand.Properties.CopyValuesFrom(flowCommand.Properties);
                    event_.CommandCollection.Items.Add(wCommand);
                    LoadPluginInfo(flowCommand.PluginInfo);
                }
                resflow.Events.Add(event_);
            }

            foreach (var _view in flow.Views)
            {
                IViewPlugin  plugin = Instance.GetViewPlugin(_view.PluginInfo.Class);
                WorkFlowView view   = plugin.CreateView();
                view.Parent     = resflow;
                view.Instance   = plugin;
                view.PluginInfo = _view.PluginInfo;
                view.Name       = _view.Name;
                view.Properties.CopyValuesFrom(_view.Properties);
                LoadPluginInfo(view.PluginInfo);
                foreach (var viewElement in _view.Elements)
                {
                    IViewElementPlugin  elementplugin = Instance.GetElementPlugin(viewElement.PluginInfo.Class);
                    WorkFlowViewElement element       = elementplugin.CreateElement(view);
                    element.Parent     = view;
                    element.Instance   = elementplugin;
                    element.PluginInfo = viewElement.PluginInfo;
                    element.Name       = viewElement.Name;
                    element.Properties.CopyValuesFrom(viewElement.Properties);
                    view.Elements.Add(element);
                    LoadPluginInfo(element.PluginInfo);
                    foreach (var commandCollection in element.Events)
                    {
                        CommandCollection loadedcommand = null;
                        foreach (var collection in viewElement.Events)
                        {
                            if (collection.Name == commandCollection.Name)
                            {
                                loadedcommand = collection;
                            }
                        }
                        if (loadedcommand != null)
                        {
                            foreach (var flowCommand in loadedcommand.Items)
                            {
                                IWorkflowCommand commandPlugin =
                                    Instance.GetCommandPlugin(flowCommand.PluginInfo.Class);
                                var wCommand = commandPlugin.CreateCommand();
                                wCommand.Instance   = commandPlugin;
                                wCommand.PluginInfo = flowCommand.PluginInfo;
                                wCommand.Name       = flowCommand.Name;
                                wCommand.Properties.CopyValuesFrom(flowCommand.Properties);
                                commandCollection.Items.Add(wCommand);
                                LoadPluginInfo(wCommand.PluginInfo);
                            }
                        }
                    }
                }
                foreach (var commandCollection in view.Events)
                {
                    CommandCollection loadedcommand = null;
                    foreach (var collection in _view.Events)
                    {
                        if (collection.Name == commandCollection.Name)
                        {
                            loadedcommand = collection;
                        }
                    }
                    if (loadedcommand != null)
                    {
                        foreach (var flowCommand in loadedcommand.Items)
                        {
                            IWorkflowCommand commandPlugin = Instance.GetCommandPlugin(flowCommand.PluginInfo.Class);
                            var wCommand = commandPlugin.CreateCommand();
                            wCommand.Instance   = commandPlugin;
                            wCommand.PluginInfo = flowCommand.PluginInfo;
                            wCommand.Name       = flowCommand.Name;
                            wCommand.Properties.CopyValuesFrom(flowCommand.Properties);
                            commandCollection.Items.Add(wCommand);
                            LoadPluginInfo(wCommand.PluginInfo);
                        }
                    }
                }
                resflow.Views.Add(view);
            }
            LoadVariables(resflow);
            return(resflow);
        }
 public Event(IEventPlugin p, string n)
 {
     //Plugin = p;
     EventPlugin = p;
     Name        = n;
 }