public async Task <IActionResult> registrar([FromBody] Constructions constructions)
        {
            try
            {
                await _GenericRepository.Add(constructions);

                _UnitOfWork.Commit();


                return(Ok(new Request()
                {
                    status = true,
                    message = "El Constructions se registro correctamente",
                    data = constructions
                }));
            }
            catch (Exception ex)
            {
                return(Ok(new Request()
                {
                    status = false,
                    message = "El Constructions no se registro correctamente!!",
                    data = ex.Message
                }));
            }
        }
        public async Task <IActionResult> modificar([FromBody] Constructions constructions)
        {
            try
            {
                await _GenericRepository.Update(constructions);

                _UnitOfWork.Commit();

                return(Ok(new Request()
                {
                    status = true,
                    message = "Esta accion se ejecuto correctamente",
                    data = constructions
                }));
            }
            catch (Exception ex)
            {
                return(Ok(new Request()
                {
                    status = false,
                    message = "Se produjo un error inesperado!!",
                    data = ex.Message
                }));
            }
        }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="constructions"></param>
 /// <returns>The Elements object.</returns>
 public Elements AddConstructions(List <Construction> constructions)
 {
     foreach (var construction  in constructions)
     {
         Constructions.Add(construction);
     }
     return(this);
 }
 public HB.ModelEnergyProperties ToHoneybee()
 {
     return(new HB.ModelEnergyProperties(
                ConstructionSets,
                Constructions.ToHoneybee(),
                Materials.ToHoneybee(),
                null, // hvacs
                ProgramTypes,
                null, // schedules
                null  // schedule type limits
                ));
 }
Beispiel #5
0
    private void RemoveAConstructionIfFullyBuilt(string Key, int index)
    {
        if (Key.Contains("Bridge"))//bz brdige will be null on below if
        {
            return;
        }

        var st = Brain.GetStructureFromKey(Key);

        if (st == null || st.StartingStage == H.Done || st.CurrentStage == 4)
        {
            PassedQueue.Remove(Key);
            Constructions.RemoveAt(index);
        }
    }
Beispiel #6
0
    /// <summary>
    /// Bz if they are fuly built sometimes they stay in the _constructions
    ///
    /// So if is fully built or being removed can be removed from _constructions
    /// </summary>
    private void RemoveFullyBuiltOrRemoved()
    {
        if (_constructions.Count == 0 || _constructions[0].Key.Contains("Bridge"))//bz brdige will be null on below if
        {
            return;
        }

        var st = Brain.GetStructureFromKey(Constructions[0].Key);

        if (st == null || st.StartingStage == H.Done)
        {
            PassedQueue.Remove(_constructions[0].Key);
            Constructions.RemoveAt(0);
        }
    }
Beispiel #7
0
        public void Test_That_All_Predefined_Constructions_Are_Accessible()
        {
            // Get all predefined types
            Enum.GetValues(typeof(PredefinedConstructionType))
            // Cast them to the right type
            .Cast <PredefinedConstructionType>()
            // Check each
            .ForEach(type =>
            {
                // Get the construction
                var construction = Constructions.GetPredefinedconstruction(type);

                // Assert
                construction.Should().NotBeNull();
                construction.Type.Should().Be(type);
            });
        }
        public void Test_That_All_Constructed_Objects_Can_Be_Examined()
        {
            // Get all composed construction
            Constructions.GetComposedConstructions()
            // For each prepare a configuration with the last object simulating it
            .Select(construction =>
            {
                // Get the loose objects
                var looseObjects = construction.Configuration.LooseObjectsHolder;

                // Return the constructed object
                return(new ConstructedConfigurationObject(construction, looseObjects.LooseObjects.ToArray()));
            })
            // For each execute the algorithm
            .ForEach(constructedObject =>
            {
                // Prepare the action executing the algorithm
                Action action = () => Producer.InferTrivialTheoremsFromObject(constructedObject);

                // Make sure there is no exception
                action.Should().NotThrow($"The construction {constructedObject} has a problem.");
            });
        }
Beispiel #9
0
        private void AddConstruction(ConstructionType type, List <Hex> coordinates)
        {
            var construction = new Construction(type, coordinates);

            Constructions.Add(construction);
        }
Beispiel #10
0
 internal void StartConstruction(BuildingType building)
 {
     Constructions.Add(new Construction(building, this, World.Calendar.Today));
 }
Beispiel #11
0
 internal void ConstructionCompleted(Construction construction)
 {
     //Buildings.Add(construction.);
     Constructions.Remove(construction);
 }
Beispiel #12
0
 void IDailyUpdatableItem.DayUpdate()
 {
     Population.DayUpdate();
     Constructions.DayUpdate();
 }