Ejemplo n.º 1
0
        //public event EventHandler<Player.Player> RefreshMonitoredObjs;

        /// <summary>
        ///     Kick off the game thread
        /// </summary>
        /// <param name="server"></param>
        /// <param name="log"></param>
        /// <param name="baseObjid"></param>
        /// <param name="system"></param>
        public DPGameRunner(DPServer server, ILogController log, uint baseObjid, StarSystem system)
        {
            Server              = server;
            Log                 = log;
            _baseObjid          = baseObjid;
            _lastAllocatedObjid = baseObjid;
            System              = system;

            foreach (var s in system.Solars)
            {
                Objects[s.Key] = s.Value;
                s.Value.Runner = this;
                if (s.Value.Loadout != null)
                {
                    RefreshObjs += s.Value.HandleTimerEvent;
                    //AddTimer(s.Value);
                }
            }


            // Start the game simulation thread
            var gameThread = new Thread(GameThreadRun);

            gameThread.Start();
        }
Ejemplo n.º 2
0
        public EngineArchetype(string datapath, FLDataFile.Section sec, ILogController log)
            : base(datapath, sec, log)
        {
            if (sec.SettingExists("max_force"))
            {
                MaxForce = sec.GetSetting("max_force").Float(0);
            }

            if (sec.SettingExists("linear_drag"))
            {
                LinearDrag = sec.GetSetting("linear_drag").Float(0);
            }

            if (sec.SettingExists("power_usage"))
            {
                PowerUsage = sec.GetSetting("power_usage").Float(0);
            }

            if (sec.SettingExists("reverse_fraction"))
            {
                ReverseFraction = sec.GetSetting("reverse_fraction").Float(0);
            }

            if (sec.SettingExists("cruise_charge_time"))
            {
                CruiseChargeTime = sec.GetSetting("cruise_charge_time").Float(0);
            }

            if (sec.SettingExists("cruise_power_usage"))
            {
                CruisePowerUsage = sec.GetSetting("cruise_power_usage").Float(0);
            }
        }
Ejemplo n.º 3
0
        public void Test_LogEventAsynchronously()
        {
            Trace.WriteLine(Configuration.GetGenericHeader());
            Guid testId = Guid.NewGuid();

            ILogController logController = LogControllerFactory.CreateLogController();

            int?initialRowCount = -1
            , rowCount          = -1;

            LogManager.GetEventPage(1, 0, out initialRowCount);

            for (int i = 0; i < logController.AsynchronousBatchSize; i++)
            {
                testId = Guid.NewGuid();

                LogManager.GetEventPage(1, 0, out rowCount);
                // the events must no be logged yet...
                Assert.AreEqual(initialRowCount, rowCount);

                AsynchronousLogManager.LogEvent(ApplicationLocation.Application, EventType.Verbose, GetTestMessage(testId));
            }

            // since the for-loop reached the batch size limit, the last LogEvent call must have saved the events at the db
            LogManager.GetEventPage(1, 0, out rowCount);
            Assert.Greater(rowCount, initialRowCount);

            Trace.WriteLine(Configuration.GetGenericFooter());
        }
Ejemplo n.º 4
0
 public ShieldGeneratorArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("regeneration_rate"))
     {
         RegenerationRate = sec.GetSetting("regeneration_rate").Float(0);
     }
     if (sec.SettingExists("max_capacity"))
     {
         MaxCapacity = sec.GetSetting("max_capacity").Float(0);
     }
     if (sec.SettingExists("offline_rebuild_time"))
     {
         OfflineRebuildTime = sec.GetSetting("offline_rebuild_time").Float(0);
     }
     if (sec.SettingExists("offline_threshold"))
     {
         OfflineThreshold = sec.GetSetting("offline_threshold").Float(0);
     }
     if (sec.SettingExists("constant_power_draw"))
     {
         ConstantPowerDraw = sec.GetSetting("constant_power_draw").Float(0);
     }
     if (sec.SettingExists("rebuild_power_draw"))
     {
         RebuildPowerDraw = sec.GetSetting("rebuild_power_draw").Float(0);
     }
 }
Ejemplo n.º 5
0
        private static void LoadWeaponModDB(string datapath, string path, ILogController log)
        {
            var ini = new FLDataFile(path, true);

            foreach (var sec in ini.Sections)
            {
                string sectionName = sec.SectionName.ToLowerInvariant();
                if (sectionName == "weapontype")
                {
                    var wt = new WeaponType {
                        Nickname = sec.GetSetting("nickname").Str(0)
                    };
                    foreach (FLDataFile.Setting set in sec.Settings)
                    {
                        if (set.SettingName.ToLowerInvariant() == "shield_mod")
                        {
                            uint  shieldTypeID = FLUtility.CreateID(set.Str(0));
                            float shieldFactor = set.Float(1);
                            wt.ShieldMods.Add(shieldTypeID, shieldFactor);
                        }
                    }
                    WeaponTypes[FLUtility.CreateID(wt.Nickname)] = wt;
                }
            }
        }
Ejemplo n.º 6
0
 //TODO: Injection has to be be defined in each api which uses this class library
 public LoggingBehavior(ILogController controller)
 {
     if (controller != null)
     {
         this.logController = controller;
     }
 }
Ejemplo n.º 7
0
 public DBManager(string collection, ILogController logController, IOptions <ConnectionStrings> connectionStrings)
 {
     if (!string.IsNullOrEmpty(collection))
     {
         _dbRepository = new MongoDbRepository <TEntity>(collection, logController, connectionStrings);
     }
 }
Ejemplo n.º 8
0
 // TODO configuration of ILogController to be done in respective services startup class
 /// <summary>
 /// Prevents a default instance of the <see cref="LogManager"/> class from being created.
 /// </summary>
 public LogManager(ILogController logController)
 {
     if (_sController == null)
     {
         _sController = logController;//new DependencyManager().Resolve<ILogController>();
     }
 }
Ejemplo n.º 9
0
        public TestDetailsViewModel(Test test, ITestItemViewModelFactory testItemViewModelFactory,
            ILogFileManager logFileManager, ILogController logController, 
            IAppController appController, IRecordingController recordingController,
            ITrainingController trainingController,
            IEventAggregator eventAggregator)
        {
            this.test = test;
            this.testItemViewModelFactory = testItemViewModelFactory;
            this.logFileManager = logFileManager;
            this.logController = logController;
            this.appController = appController;
            this.recordingController = recordingController;
            this.trainingController = trainingController;

            eventAggregator.GetEvent<AddTestItemEvent>().Subscribe(AddTestItemEventHandler);
            //TestItems = new ObservableCollection<ITestItemViewModel>(test.TestItems.Select(testItemViewModelFactory.Create));
            RefreshTestItems();
            PlayCommand = new DelegateCommand(ExecutePlayCommand);
            AppendToEndOfTestCommand = new DelegateCommand(ExecuteAppendToEndOfTestCommand);
            AppendToStartOfTestCommand = new DelegateCommand(ExecuteAppendToStartOfTestCommand);
            AppendAfterSelectedItemCommand = new DelegateCommand(ExecuteAppendAfterSelectedItemCommand);
            DeleteSelectedItemCommand = new DelegateCommand(ExecuteDeleteSelectedItemCommand);
            RefreshCommand = new DelegateCommand(ExecuteRefresh);
            RunAsTrainingCommand = new DelegateCommand(EecuteRunAsTrainingCommand);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Publisher&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="queueManager">The queue manager.</param>
 /// <param name="logger">The logger.</param>
 public Publisher(IQueueAdapter queueManager, IBusLogger logger, ILogController logController, IOptions <ConnectionStrings> connectionStrings, IOptions <AzureServiceBusConfiguration> serviceBusConfiguration) : base(logController, connectionStrings, serviceBusConfiguration)
 {
     this.logger        = logger;
     this._queueManager = queueManager;
     queueManager.Initialize();
     this.logController = logController;
 }
Ejemplo n.º 11
0
 public Publisher(ILogController logController, IOptions <ConnectionStrings> connectionStrings, IOptions <AzureServiceBusConfiguration> serviceBusConfiguration) : base(logController, connectionStrings, serviceBusConfiguration)
 {
     _queueManager = this.BuildDefaultQueueAdapter();
     logger        = this.BuildLogger();
     _queueManager.Initialize();
     this.logController = logController;
 }
Ejemplo n.º 12
0
 public MainForm(ILogController logController)
 {
     InitializeComponent();
     WindowPanel   = windowPanel;
     LogController = logController;
     initializeWindow();
 }
Ejemplo n.º 13
0
        public LauncherArchetype(string datapath, FLDataFile.Section sec, ILogController log)
            : base(datapath, sec, log)
        {
            if (sec.SettingExists("damage_per_fire"))
            {
                DamagePerFire = sec.GetSetting("damage_per_fire").Float(0);
            }
            if (sec.SettingExists("power_usage"))
            {
                PowerUsage = sec.GetSetting("power_usage").Float(0);
            }
            if (sec.SettingExists("refire_delay"))
            {
                RefireDelay = sec.GetSetting("refire_delay").Float(0);
            }

            if (sec.SettingExists("muzzle_velocity"))
            {
                MuzzleVelocity = new Vector(0, 0, -sec.GetSetting("muzzle_velocity").Float(0));
            }

            if (sec.SettingExists("projectile_archetype"))
            {
                uint projectileArchID = FLUtility.CreateID(sec.GetSetting("projectile_archetype").Str(0));
                ProjectileArch = ArchetypeDB.Find(projectileArchID) as ProjectileArchetype;
                if (ProjectileArch == null)
                {
                    log.AddLog(LogType.ERROR, "error: projectile not found: " + sec.Desc);
                }
            }
        }
Ejemplo n.º 14
0
 public ArmorArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("hit_pts_scale"))
     {
         HitPtsScale = sec.GetSetting("hit_pts_scale").Float(0);
     }
 }
Ejemplo n.º 15
0
        public MunitionArchetype(string datapath, FLDataFile.Section sec, ILogController log)
            : base(datapath, sec, log)
        {
            if (sec.SettingExists("hull_damage"))
            {
                HullDamage = sec.GetSetting("hull_damage").Float(0);
            }
            if (sec.SettingExists("energy_damage"))
            {
                EnergyDamage = sec.GetSetting("energy_damage").Float(0);
            }
            if (sec.SettingExists("weapon_type"))
            {
                WeaponType = ArchetypeDB.FindWeaponType(sec.GetSetting("weapon_type").Str(0));
                if (WeaponType == null)
                {
                    log.AddLog(LogType.ERROR, "error: weapon_type not found " + sec.Desc);
                }
            }
            if (sec.SettingExists("seeker"))
            {
                Seeker = sec.GetSetting("seeker").Str(0);
            }
            if (sec.SettingExists("time_to_lock"))
            {
                TimeToLock = sec.GetSetting("time_to_lock").Float(0);
            }
            if (sec.SettingExists("seeker_range"))
            {
                SeekerRange = sec.GetSetting("seeker_range").Float(0);
            }
            if (sec.SettingExists("seeker_fov_deg"))
            {
                SeekerFovDeg = sec.GetSetting("seeker_fov_deg").Float(0);
            }
            if (sec.SettingExists("detonation_dist"))
            {
                DetonationDist = sec.GetSetting("detonation_dist").Float(0);
            }
            if (sec.SettingExists("cruise_disruptor"))
            {
                CruiseDisruptor = sec.GetSetting("cruise_disruptor").Str(0) == "true";
            }
            if (sec.SettingExists("max_angular_velocity"))
            {
                MaxAngularVelocity = sec.GetSetting("max_angular_velocity").Float(0);
            }

            if (sec.SettingExists("motor"))
            {
                uint motorID = FLUtility.CreateID(sec.GetSetting("motor").Str(0));
                MotorArch = ArchetypeDB.Find(motorID) as MotorArchetype;
                if (MotorArch == null)
                {
                    log.AddLog(LogType.ERROR, "error: motor not found " + sec.Desc);
                }
            }
        }
Ejemplo n.º 16
0
        public LogNode(ProjectFile logFile, ILogFileManager logFileManager,
            ILogController logController)
        {
            this.logFile = logFile;
            this.logFileManager = logFileManager;
            this.logController = logController;

            DefaultCommand = new DelegateCommand(ExecuteDefaultCommand);
        }
Ejemplo n.º 17
0
 public MongoDbRepository(string collectionName, ILogController logController, IOptions <ConnectionStrings> connectionStrings)
 {
     logManager            = new LogManager(logController);
     this.collectionName   = collectionName;
     this.connectionString = connectionStrings.Value.ConnectionString;
     this.databaseName     = connectionStrings.Value.DatabaseName;
     GetDatabase();
     GetCollection();
 }
        /// <summary>
        ///     Start things running
        /// </summary>
        /// <param name="log"></param>
        public DPServer(ILogController log)
        {
            _log = log;

            // Start the game simulation thread
            var masterThread = new Thread(ThreadRun);

            masterThread.Start();
        }
Ejemplo n.º 19
0
 private static void LoadGenericScripts(FLDataFile ini, ILogController log)
 {
     foreach (FLDataFile.Section sec in ini.Sections)
     {
         string currentSetSegment = "";
         bool   currentSetGender  = false;
         bool   currentSetPosture = false;
         foreach (var set in sec.Settings)
         {
             if (set.SettingName == "set_segment")
             {
                 currentSetSegment = set.Str(0).ToLowerInvariant();
             }
             else if (set.SettingName == "set_gender")
             {
                 string gender = set.Str(0).ToLowerInvariant();
                 if (gender == "male")
                 {
                     currentSetGender = true;
                 }
                 else if (gender == "female")
                 {
                     currentSetGender = false;
                 }
                 else
                 {
                     throw new Exception("invalid set_gender");
                 }
             }
             else if (set.SettingName == "set_posture")
             {
                 string posture = set.Str(0).ToLowerInvariant();
                 if (posture == "stand")
                 {
                     currentSetPosture = true;
                 }
                 else if (posture == "sitlow")
                 {
                     currentSetPosture = false;
                 }
                 else
                 {
                     throw new Exception("invalid set_posture");
                 }
             }
             else if (set.SettingName == "script")
             {
                 var setSegment = GetSetSegment(currentSetSegment, currentSetGender,
                                                currentSetPosture);
                 string script = set.Str(0).ToLowerInvariant();
                 setSegment.Scripts.Add(script);
             }
         }
     }
 }
Ejemplo n.º 20
0
        /// <summary>
        ///     Load base market data and setup the prices for goods at each base.
        /// </summary>
        /// <param name="path"></param>
        private static void LoadBaseMarketData(string path, ILogController log)
        {
            var ini = new FLDataFile(path, true);

            foreach (var sec in ini.Sections)
            {
                string sectionName = sec.SectionName.ToLowerInvariant();

                if (sectionName != "basegood")
                {
                    continue;
                }

                var basedata = FindBase(sec.GetSetting("base").Str(0));
                if (basedata == null)
                {
                    log.AddLog(LogType.ERROR, "error: " + sec.Desc);
                    continue;
                }

                foreach (FLDataFile.Setting set in sec.Settings)
                {
                    var settingName = set.SettingName.ToLowerInvariant();
                    if (settingName != "marketgood")
                    {
                        continue;
                    }
                    var nickname                 = set.Str(0);
                    var level_needed_to_buy      = set.Float(1);
                    var reputation_needed_to_buy = set.Float(2);
                    var baseSells                = (set.UInt(5) == 1);
                    var basePriceMultiplier      = 1.0f;
                    if (set.NumValues() > 6)
                    {
                        basePriceMultiplier = set.Float(6);
                    }

                    var goodid = FLUtility.CreateID(nickname);
                    var good   = FindGood(goodid);
                    if (good == null)
                    {
                        log.AddLog(LogType.ERROR, "error: " + set.Desc);
                        continue;
                    }

                    if (baseSells)
                    {
                        basedata.GoodsForSale[goodid] = good.BasePrice * basePriceMultiplier;
                    }

                    basedata.GoodsToBuy[goodid] = good.BasePrice * basePriceMultiplier;
                }
            }
        }
Ejemplo n.º 21
0
        public LogControllerWrapper(IRepositoryFactory repositoryFactory)
        {
            var logHub          = new Mock <IHubContext <LogHub, ILogHub> >();
            var mockClients     = new Mock <IHubClients <ILogHub> >();
            var mockClientProxy = new Mock <ILogHub>();

            mockClients.Setup(clients => clients.All).Returns(mockClientProxy.Object);
            logHub.Setup(x => x.Clients).Returns(() => mockClients.Object);

            _logController = new LogController(null, repositoryFactory, logHub.Object);
        }
Ejemplo n.º 22
0
 public ThrusterArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("max_force"))
     {
         MaxForce = sec.GetSetting("max_force").Float(0);
     }
     if (sec.SettingExists("power_usage"))
     {
         PowerUsage = sec.GetSetting("power_usage").Float(0);
     }
 }
Ejemplo n.º 23
0
 public GunArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("dispersion_angle"))
     {
         DispersionAngle = sec.GetSetting("dispersion_angle").Float(0);
     }
     if (sec.SettingExists("turn_rate"))
     {
         TurnRate = sec.GetSetting("turn_rate").Float(0);
     }
 }
Ejemplo n.º 24
0
        public LogManager( /* IConfigManager configManager,*/ ILogController logController)
        {
            //System.Xml.XmlElement configXml = configManager.GetSectionXml( "log4net" );
            //this.LogController = new Log4NetLogController( "NGin.Core", configXml );

            if ( logController == null )
            {
                throw new ManagerInitializationException("Dependency ILogController was null.");
            }

            this.LogController = logController;
        }
Ejemplo n.º 25
0
        public ScannerArchetype(string datapath, FLDataFile.Section sec, ILogController log)
            : base(datapath, sec, log)
        {
            if (sec.SettingExists("range"))
            {
                ScanRange = sec.GetSetting("range").UInt(0);
            }

            if (sec.SettingExists("cargo_scan_range"))
            {
                CargoRange = sec.GetSetting("cargo_scan_range").UInt(0);
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        ///     Load shop information for equipment and commodities.
        /// </summary>
        /// <param name="path"></param>
        private static void LoadGoodData(string path, ILogController log)
        {
            var ini = new FLDataFile(path, true);

            foreach (FLDataFile.Section sec in ini.Sections)
            {
                var sectionName = sec.SectionName.ToLowerInvariant();
                if (sectionName != "good")
                {
                    continue;
                }
                var good = new Good {
                    Nickname = sec.GetSetting("nickname").Str(0)
                };
                good.GoodID = FLUtility.CreateID(good.Nickname);
                string category = sec.GetSetting("category").Str(0);
                if (category == "equipment")
                {
                    good.category  = Good.Category.Equipment;
                    good.BasePrice = sec.GetSetting("price").Float(0);
                    uint archid = FLUtility.CreateID(sec.GetSetting("equipment").Str(0));
                    good.EquipmentOrShipArch = ArchetypeDB.Find(archid);
                }
                else if (category == "commodity")
                {
                    good.category  = Good.Category.Commodity;
                    good.BasePrice = sec.GetSetting("price").Float(0);
                    uint archid = FLUtility.CreateID(sec.GetSetting("equipment").Str(0));
                    good.EquipmentOrShipArch = ArchetypeDB.Find(archid);
                }
                else if (category == "shiphull")
                {
                    good.category  = Good.Category.ShipHull;
                    good.BasePrice = sec.GetSetting("price").Float(0);
                    uint archid = FLUtility.CreateID(sec.GetSetting("ship").Str(0));
                    good.EquipmentOrShipArch = ArchetypeDB.Find(archid);
                }
                else if (category == "ship")
                {
                    good.category = Good.Category.ShipPackage;
                    uint goodid = FLUtility.CreateID(sec.GetSetting("hull").Str(0));
                    good.Shiphull = Goods[goodid];
                }
                else
                {
                    log.AddLog(LogType.ERROR, "error: unknown category " + sec.Desc);
                }

                Goods[good.GoodID] = good;
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Constructor
        /// </summary>
        //public AzureQueueHelper(ILogController logController)
        //{
        //    //this.httpContextAccessor = httpContextAccessor;

        //    _dbManageFileTrigger = new DBManager<FileTrigger>(fileTriggerCollectionName, logController).Instance;
        //    _dbManageEmailTrigger = new DBManager<EmailTrigger>(emailTriggerCollectionName, logController).Instance;
        //    _dbManageTimeTrigger = new DBManager<TimeTrigger>(timeTriggerCollectionName, logController).Instance;
        //    _dbIFTTTRepository = new DBManager<IFTTTApplet>(iFTTTCollectionName, logController).Instance;
        //    _workflowInstanceDbRepository = new DBManager<WorkflowInstance>(workflowInstanceCollectionName, logController).Instance;
        //    _workflowDbRepository = new DBManager<Workflow>(workflowCollectionName, logController).Instance;
        //    _agentConfigurationDBRepository = new DBManager<AgentConfiguration>(agentConfigurationcollectionName, logController).Instance;
        //    _LogManager = new LogManager(logController);
        //}
        public AzureQueueHelper(ILogController logController, IOptions <ConnectionStrings> connectionStrings, IOptions <AzureServiceBusConfiguration> serviceBusConfiguration)
        {
            //this.httpContextAccessor = httpContextAccessor;

            _dbManageFileTrigger            = new DBManager <FileTrigger>(fileTriggerCollectionName, logController, connectionStrings).Instance;
            _dbManageEmailTrigger           = new DBManager <EmailTrigger>(emailTriggerCollectionName, logController, connectionStrings).Instance;
            _dbManageTimeTrigger            = new DBManager <TimeTrigger>(timeTriggerCollectionName, logController, connectionStrings).Instance;
            _dbIFTTTRepository              = new DBManager <IFTTTApplet>(iFTTTCollectionName, logController, connectionStrings).Instance;
            _workflowInstanceDbRepository   = new DBManager <WorkflowInstance>(workflowInstanceCollectionName, logController, connectionStrings).Instance;
            _workflowDbRepository           = new DBManager <Workflow>(workflowCollectionName, logController, connectionStrings).Instance;
            _agentConfigurationDBRepository = new DBManager <AgentConfiguration>(agentConfigurationcollectionName, logController, connectionStrings).Instance;
            _LogManager = new LogManager(logController);
            _serviceBusConfiguration = serviceBusConfiguration;
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Gets the Log section settings of the app.config
        /// </summary>
        public static ILogController CreateLogController()
        {
            LogSection section = (LogSection)ConfigurationManager.GetSection(SECTION_NAME);

            if (!string.IsNullOrEmpty(section.LogSectionProviderType))
            {
                ILogController customController = Activator.CreateInstance(Type.GetType(section.LogSectionProviderType)) as ILogController;
                if (customController != null)
                {
                    return(customController.CreateLogControllerInstance());
                }
            }

            return(section);
        }
        /// <summary>
        ///     At object creation time we assume that the freelancer player has connected to the
        ///     proxy server and is expecting the normal freelancer server login sequence. This
        ///     class manages this message exchange until they select a character at which point
        ///     the controller will establish a connection to a slave freelancer server and
        ///     forward traffic between the two.
        /// </summary>
        /// <param name="dplayid"></param>
        /// <param name="log"></param>
        /// <param name="flplayerid"></param>
        /// <param name="runner"></param>
        public Player(Session dplayid, ILogController log, uint flplayerid, DPGameRunner runner)
        {
            DPSess     = dplayid;
            Log        = log;
            FLPlayerID = flplayerid;
            Runner     = runner;
            Ship       = new Old.Object.Ship.Ship(runner)
            {
                player = this
            };
            Wgrp = new WeaponGroup();

            _state = DPCLoginState.Instance();
            _state.EnterState(this);
        }
Ejemplo n.º 30
0
 public CounterMeasureArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("linear_drag"))
     {
         LinearDrag = sec.GetSetting("linear_drag").Float(0);
     }
     if (sec.SettingExists("range"))
     {
         Range = sec.GetSetting("range").Float(0);
     }
     if (sec.SettingExists("diversion_pctg"))
     {
         DiversionPctg = sec.GetSetting("diversion_pctg").Float(0);
     }
 }
Ejemplo n.º 31
0
 public EquipmentArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("volume"))
     {
         Volume = sec.GetSetting("volume").Float(0);
     }
     if (sec.SettingExists("units_per_container"))
     {
         UnitsPerContainer = sec.GetSetting("units_per_container").Float(0);
     }
     if (sec.SettingExists("lootable"))
     {
         Lootable = sec.GetSetting("lootable").Str(0) == "true";
     }
 }
Ejemplo n.º 32
0
 public ShipArchetype(string datapath, FLDataFile.Section sec, ILogController log)
     : base(datapath, sec, log)
 {
     if (sec.SettingExists("steering_torque"))
     {
         SteeringTorque = sec.GetSetting("steering_torque").Vector();
     }
     if (sec.SettingExists("angular_drag"))
     {
         AngularDrag = sec.GetSetting("angular_drag").Vector();
     }
     if (sec.SettingExists("rotation_inertia"))
     {
         RotationInertia = sec.GetSetting("rotation_inertia").Vector();
     }
     if (sec.SettingExists("nudge_force"))
     {
         NudgeForce = sec.GetSetting("nudge_force").Float(0);
     }
     if (sec.SettingExists("linear_drag"))
     {
         LinearDrag = sec.GetSetting("linear_drag").Float(0);
     }
     if (sec.SettingExists("hold_size"))
     {
         HoldSize = sec.GetSetting("hold_size").Float(0);
     }
     if (sec.SettingExists("strafe_force"))
     {
         StrafeForce = sec.GetSetting("strafe_force").Float(0);
     }
     if (sec.SettingExists("nanobot_limit"))
     {
         NanobotLimit = sec.GetSetting("nanobot_limit").UInt(0);
     }
     if (sec.SettingExists("shield_battery_limit"))
     {
         ShieldBatteryLimit = sec.GetSetting("shield_battery_limit").UInt(0);
     }
     if (sec.SettingExists("mission_property"))
     {
         mission_property =
             (MissionProperty)
             Enum.Parse(typeof(MissionProperty),
                        sec.GetSetting("mission_property").Str(0).ToUpperInvariant());
     }
 }
Ejemplo n.º 33
0
        // <summary>
        /// Load the factions from initial world.
        /// </summary>
        /// <param name="path"></param>
        private static void LoadFactions(string path, ILogController log)
        {
            var ini = new FLDataFile(path, true);

            foreach (FLDataFile.Section sec in ini.Sections)
            {
                string sectionName = sec.SectionName.ToLowerInvariant();
                if (sectionName == "group")
                {
                    var faction = new Faction {
                        Nickname = sec.GetSetting("nickname").Str(0)
                    };
                    faction.FactionID          = FLUtility.CreateFactionID(faction.Nickname);
                    Factions[faction.Nickname] = faction;
                }
            }
        }
Ejemplo n.º 34
0
        public Engine(IFovStrategy fovStrategy, ITileFactory tileFactory, World world, IInputHandler input, ILogController gameLog, ConsoleWindow console)
        {
            FovStrategy = fovStrategy;
            TileFactory = tileFactory;
            World = world;
            InputHandler = input;
            Console = console;

            if (ActorControllers == null)
            {
                ActorControllers = new List<IController>();
            }

            if (FurnitureControllers == null)
            {
                FurnitureControllers = new List<IController>();
            }

            GameLogController = gameLog;
        }
        public ApplicationController(Lazy<ShellViewModel> shellViewModelLazy,
            Lazy<SettingsViewModel> settingsViewModelLazy,
            Lazy<AboutViewModel> aboutViewModelLazy, Lazy<HelpViewModel> helpViewModelLazy,
            Lazy<LogViewModel> logViewModelLazy,
            Lazy<ShellService> shellServiceLazy, CompositionContainer compositionContainer,
            Lazy<IAccountAuthenticationService> accountAuthenticationServiceLazy, IShellController shellController,
            Lazy<SystemTrayNotifierViewModel> lazySystemTrayNotifierViewModel,
            IGuiInteractionService guiInteractionService, ILogController logController)
        {
            //ViewModels
            _shellViewModel = shellViewModelLazy.Value;
            _settingsViewModel = settingsViewModelLazy.Value;
            _aboutViewModel = aboutViewModelLazy.Value;
            _helpViewModel = helpViewModelLazy.Value;
            _logViewModel = logViewModelLazy.Value;
            _systemTrayNotifierViewModel = lazySystemTrayNotifierViewModel.Value;
            //Commands
            _shellViewModel.Closing += ShellViewModelClosing;
            _exitCommand = new DelegateCommand(Close);

            //Services
            AccountAuthenticationService = accountAuthenticationServiceLazy.Value;

            _shellService = shellServiceLazy.Value;
            _shellService.ShellView = _shellViewModel.View;
            _shellService.SettingsView = _settingsViewModel.View;
            _shellService.AboutView = _aboutViewModel.View;
            _shellService.HelpView = _helpViewModel.View;
            _shellService.LogView = _logViewModel.View;
            _shellController = shellController;
            _guiInteractionService = guiInteractionService;
            _logController = logController;
            if (_shellViewModel.IsSettingsVisible)
            {
                _settingsViewModel.Load();
            }
        }
Ejemplo n.º 36
0
 public LogControlProvider(ILogReader aLogReader, ILogController aLogController)
 {
     iLogReader = aLogReader;
     iLogController = aLogController;
 }
Ejemplo n.º 37
0
 public LogSystem(ILogReader aLogReader, ILogController aLogController)
 {
     LogReader = aLogReader;
     LogController = aLogController;
 }
Ejemplo n.º 38
0
 public PersistentLogController(ILogController aWrappedLogController, string aSettingsFileName)
 {
     iWrappedLogController = aWrappedLogController;
     iSettingsFileName = aSettingsFileName;
 }
		public TagModifyController(ILogController logController)
		{
			_logController = logController;
		}
Ejemplo n.º 40
0
 public EntityMoveHelper(World world, ILogController gameLog)
 {
     World = world;
     GameLog = gameLog;
 }