コード例 #1
0
 public void RegisterProperty()
 {
     // Checking if the property gets registered correctly
     PropertyHandler.RegisterProperty("UnitTest", ref testProp);
     Assert.Contains("UnitTest", PropertyHandler.GetProperties().Keys);
     Assert.Throws(typeof(PropertyHandlerException),
                   () => PropertyHandler.RegisterProperty("UnitTest", ref testProp));
     _registerPropertyTestRan = true;
 }
コード例 #2
0
 public void Register()
 {
     try
     {
         PropertyHandler.RegisterProperty($"{Name}.tickRate", ref tickRate);
     } catch (Exception)
     {
         App.Console?.Print($"Unable to register tickRate property for {Name} loop", Colors.Yellow);
     }
 }
コード例 #3
0
ファイル: GPSSystem.cs プロジェクト: TheKoen/SE1d3-KBS2
        public static void Setup()
        {
            AlgorithmAStar.ClearCache();

            try
            {
                PropertyHandler.RegisterProperty("startingPrice", ref StartingPrice);
                PropertyHandler.RegisterProperty("pricePerKilometer", ref PricePerKilometer);
            }
            catch (Exception)
            {
                App.Console?.Print($"Unable to register properties for GPSSystem", Colors.Yellow);
            }
        }
コード例 #4
0
 public CityController(City city)
 {
     City = city;
     PropertyHandler.RegisterProperty("customerSpawnRate", ref customerSpawnRate);
 }