/// <summary> /// Executes this command. /// </summary> /// <param name="Level">The level.</param> internal override void Execute(Level Level) { if (this.Data != null) { if (this.Data.GetBuildingClassData() != null || this.Data.IsArtifact() || this.Data.IsPrototype()) { ResourceBundle Cost = this.Data.GetBuildCost(0); if (!this.Data.IsArtifact()) { if (this.Data.IsPrototype()) { // TODO Implement Prototype. } if (this.Instant) { // TODO Implement Instant Buy. } else { if (Level.Player.HasEnoughWorkersAndResources(Cost)) { if (Cost.IsPremiumCurrency()) { Level.Player.Diamonds -= Cost.Resources[0].Count; } for (int i = 1; i < 5; i++) { if (Cost.Resources[i].Count != -1) { Level.Player.Resources.Remove(Cost.Resources[i].Data, Cost.Resources[i].Count); } } this.ExecuteBuild(Level.Player, false, false, false); } } } } } }