Exemplo n.º 1
0
 public void AddOrUpdateBuildingRule(string type, SchemeBuilder builder)
 {
     mBuildingRules[type] = builder;
     if (SchemesChanged != null)
     {
         SchemesChanged.Invoke();
     }
 }
Exemplo n.º 2
0
 private void LoadVisualSchemes()
 {
     mBuildingRules[NumberDisplay.Type]  = new NumberDisplayBuilder();
     mBuildingRules[SimulationStop.Type] = new SimulationStopBuilder();
     if (SchemesChanged != null)
     {
         SchemesChanged.Invoke();
     }
 }
Exemplo n.º 3
0
 public void LoadSchemes()
 {
     try
     {
         var serialisedRules = ApplicationSettings.Load("BuildingRules");
         mBuildingRules = MyJsonSerializer.Deserialize <Dictionary <string, SchemeBuilder> >(serialisedRules);
         if (SchemesChanged != null)
         {
             SchemesChanged.Invoke();
         }
     }
     catch (Exception)
     {
         Console.Instance.Log("Произошла ошибка при загрузке схем");
         ResetBuildungRules();
     }
 }
Exemplo n.º 4
0
 private void LoadBaseSchemes()
 {
     mBuildingRules[NAND.Type]     = new NANDBuilder();
     mBuildingRules[CONST.Type]    = new CONSTBuilder();
     mBuildingRules[DFF.Type]      = new DFFBuilder();
     mBuildingRules[NANDX.Type]    = new NANDXBuilder();
     mBuildingRules[ANDX.Type]     = new ANDXBuilder();
     mBuildingRules[ORX.Type]      = new ORXBuilder();
     mBuildingRules[NOTX.Type]     = new NOTXBuilder();
     mBuildingRules[XORX.Type]     = new XORXBuilder();
     mBuildingRules[RAMX.Type]     = new RAMXBuilder();
     mBuildingRules[IntConst.Type] = new IntConstBuilder();
     if (SchemesChanged != null)
     {
         SchemesChanged.Invoke();
     }
 }