public HarvestResource(Actor self, int2 cell) { harv = self.Trait<Harvester>(); facing = self.Trait<IFacing>(); renderUnit = self.Trait<RenderUnit>(); resourceLayer = self.World.WorldActor.Trait<ResourceLayer>(); harvestCell = cell; }
void Start() { _controller = LevelManager.Instance.PlayerControl; _navMeshAgent = GetComponent <NavMeshAgent>(); _harvester = GetComponent <Harvester>(); _builder = GetComponent <Builder>(); _inventory = GetComponent <Inventory>(); _controller.TargetLocationChanged += OnTargetLocationChanged; _controller.TargetCommandChanged += OnTargetCommandChanged; CoreContainerViewModel.Instance.MainInventory = _inventory; }
public string RegisterHarvester(List <string> arguments) { try { Harvester harvester = harvesterFactory.CreateHarvester(arguments); harvesters.Add(harvester); return($"Successfully registered {harvester.Type} Harvester - {harvester.Id}"); } catch (ArgumentException ae) { return(ae.Message); } }
public string RegisterHarvester(List <string> arguments) { try { Harvester newHarvester = HarvesterFactory.CreateHarvester(arguments); this.harvesters.Add(newHarvester); return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}"); } catch (ArgumentException err) { return(err.Message); } }
private void FormMain_Load(object sender, EventArgs e) { // load storage _storage = StorageFactory.LoadFromDisk(); // start harvester _harvester = new Harvester(_storage); // and start listener _listener = new Listener(_storage); // and start the timer _timerRefresh.Start(); }
public IHarvester GenerateHarvester(IList <string> args) { string type = args[0]; var id = int.Parse(args[1]); var oreOutput = double.Parse(args[2]); var energyReq = double.Parse(args[3]); Type clazz = Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(t => t.Name == type + "Harvester"); var ctors = clazz.GetConstructors(BindingFlags.Public | BindingFlags.Instance); Harvester harvester = (Harvester)ctors[0].Invoke(new object[] { id, oreOutput, energyReq }); return(harvester); }
public void Test1() { var h = new Harvester(@"D:\code\TrueCards\src\TrueCards\bin\Release", @"d:\users\roverby\mywixfile.wxs", "ProgramFilesDirectory", "ProductComponents") { ExcludeFiles = new[] { "*.pdb", "*.xml", "*.vshost.exe*" } } .ModifyComponentsWhere(c => c.File.Info.Extension.Equals(".exe", StringComparison.OrdinalIgnoreCase), (c, xe) => xe.Elements(Constants.WixNs + "File").Single().Add(new XAttribute("Checksum", "yes"))); var xml = h.Harvest(); Console.Write(xml.ToString()); }
public QonqrManager() { _apiCall = new ApiCall(); _statistics = new Stats(); _zonesList = new List<Zoneski>(); _harvest = new Harvester(); _fortsList = new List<Zoneski>(); _launch = new Launcher(); ConfigFile configFile = new ConfigFile(); _accounts = configFile.GetAccounts(); ResetCoordinates(); }
public string RegisterHarvester(List <string> arguments) { try { Harvester harvester = harvesterFactory.CreateHarvester(arguments); this.Harvesters.Add(harvesterFactory.CreateHarvester(arguments)); return(string.Format(Messages.RegisterHarvesterMessage, harvester.Type, harvester.Id)); //return $"Successfully registered {harvester.Type} Harvester - {harvester.Id}"; } catch (ArgumentException e) { return(e.Message); } }
public override void UpdateInteract(GameTime time) { SceneObject obj = parent.Scene.Scene.FindObject(selectRay, SelFilter.Instance); MouseHoverObject = obj as ISelectableObject; MouseHoverCity = MouseHoverObject as City; Harvester harv = MouseHoverObject as Harvester; if (harv != null && !harv.IsInVisibleRange) { MouseHoverObject = null; } }
public string RegisterHarvester(List <string> arguments) { try { Harvester harvester = HarvesterFactory.Create(arguments.ToArray()); idsHarvesters[arguments[1]] = harvester; return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}"); } catch (ArgumentException ae) { return(ae.Message); } }
public string RegisterHarvester(List <string> arguments) { try { Harvester harvester = harvesterFactory.CreateHarvester(arguments); this.harvesters.Add(harvester); return($"Successfully registered {arguments[0]} Harvester - {harvester.Id}"); } catch (ArgumentException ex) { return(ex.Message); } }
public static void Main(string[] args) { Harvester harvester = new Harvester(); while (true) { Commands command = (Commands)Enum.Parse(typeof(Commands), Console.ReadLine()); if (command == Commands.Harvest) { break; } Console.WriteLine(harvester.GiveCommand(command)); } }
public void ResetDatabase() { // Import "TestPeopleMaintenance/input1 plus testhyphens.xls" into the People table People PeopleFromFile = new People( AppDomain.CurrentDomain.BaseDirectory + "\\Unit Tests\\TestPeopleMaintenance", "input1 plus testhypens.xls"); DB = new Database("Publication Harvester Unit Test"); Harvester harvester = new Harvester(DB); harvester.CreateTables(); MockNCBI mockNCBI = new MockNCBI("medline"); mockNCBI.SearchThrowsAnError = false; PublicationTypes ptc = new PublicationTypes( AppDomain.CurrentDomain.BaseDirectory + "\\Unit Tests\\TestPublicationTypes", "PublicationTypes.csv" ); ptc.WriteToDB(DB); // Anonymous callback functions for GetPublications Harvester.GetPublicationsStatus StatusCallback = delegate(int number, int total, int averageTime) { // }; Harvester.GetPublicationsMessage MessageCallback = delegate(string Message, bool StatusBarOnly) { // }; Harvester.CheckForInterrupt InterruptCallback = delegate() { return(false); }; // Write the people, then "harvest" the publications using MockNCBI double AverageMilliseconds; foreach (Person person in PeopleFromFile.PersonList) { person.WriteToDB(DB); harvester.GetPublications(mockNCBI, ptc, person, StatusCallback, MessageCallback, InterruptCallback, out AverageMilliseconds); } People PeopleFromDB = new People(DB); Assert.AreEqual(PeopleFromDB.PersonList.Count, 4); }
static void TestHarvester() { // load storage from disk var storage = StorageFactory.LoadFromDisk(); // create harvester using (var harvester = new Harvester(storage)) { // wait 60 seconds Thread.Sleep(60 * 1000); } // and save the storage StorageFactory.SaveToDisk(storage); }
public string RegisterHarvester(List <string> arguments) { try { var type = arguments[0]; Harvester harvester = HarvesterFactory.Get(type, arguments.Skip(1).ToList()); this.harvesters.Add(harvester); return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}"); } catch (Exception e) { return(e.Message); } }
public void HandleHarvesterDestination(Unit unit) { Harvester harvester = (Harvester)unit; if (!harvester.HasResources) { harvester.Harvesting = true; harvester.CanMoveInTurn = false; } else { harvester.Player.Resources.AddResources(harvester.ResourceCarryAmount); harvester.HasResources = false; } }
public List <Tile> GetPathToDestination(Unit unit, Tile start) { List <Tile> path = null; Harvester harvester = (Harvester)unit; if (harvester.HasResources) { path = ChooseBestPath(start, TileGrid.GetTileWithBase(start, harvester.Player)); } else { path = GetPathToClosestResourceNode(start); } return(path); }
public static Harvester Get(string type, List <string> arguments) { Harvester harvester = null; switch (type) { case "Hammer": harvester = new HammerHarvester(arguments[1], double.Parse(arguments[2]), double.Parse(arguments[3])); break; case "Sonic": harvester = new SonicHarvester(arguments[1], double.Parse(arguments[2]), double.Parse(arguments[3]), int.Parse(arguments[4])); break; } return(harvester); }
/// <summary> /// /// </summary> /// <param name="options"></param> public DataImportTask(DataImportTaskOptions options) { _options = options; string tmpGuid = Guid.NewGuid().ToString(); _harvester = new Harvester <T>(_options.ThreadCount); if (options.Integration != null) { if (options.Integration.Fields.Count == 0) { throw new InvalidOperationException("Integration needs to have at least 1 field."); } _integration = options.Integration; _integration.APIKey = _options.ApiKey; if (string.IsNullOrEmpty(_integration.FeaturesCollection)) { _integration.FeaturesCollection = $"{_integration.Collection}_features"; } if (string.IsNullOrEmpty(_integration.Collection)) { _integration.Collection = tmpGuid; } _harvester.AddIntegration(options.Integration, _options.Source); } else { _integration = _harvester.AddIntegrationSource(_options.Source, _options.ApiKey, _options.IntegrationName, tmpGuid); } var outCollection = new DestinationCollection(_integration.Collection, _integration.GetReducedCollectionName()); OutputDestinationCollection = outCollection; if (options.TotalEntryLimit > 0) { _harvester.LimitEntries(options.TotalEntryLimit); } if (options.ShardLimit > 0) { _harvester.LimitShards(options.ShardLimit); } this.EncodeOnImport = options.EncodeInput; if (this.EncodeOnImport) { _encoder = FieldEncoder.Factory.Create(_integration); } // new OneHotEncoding(new FieldEncodingOptions { Integration = _integration }); }
void Process_harvester(Harvester harvester, VesselAnalyzer va) { if (harvester.running && harvester.simulated_abundance > harvester.min_abundance) { SimulatedRecipe recipe = new SimulatedRecipe(harvester.part, "harvester"); if (harvester.ec_rate > double.Epsilon) { recipe.Input("ElectricCharge", harvester.ec_rate); } recipe.Output( harvester.resource, Harvester.AdjustedRate(harvester, new CrewSpecs("Engineer@0"), va.crew, harvester.simulated_abundance), dump: false); recipes.Add(recipe); } }
public string Check(List <string> arguments) { var id = arguments[1]; if (harvesters.Any(h => h.Id == id)) { Harvester harvester = harvesters.Find(h => h.Id == id); return(harvester.ToString()); } else if (providers.Any(p => p.Id == id)) { Provider provider = providers.Find(p => p.Id == id); return(provider.ToString()); } return($"No element found with id - {id}"); }
public Harvester ProduceHarvester(string type, string id, double oreOutput, double energyRequirement, int sonicFactor = 0) { Harvester newHarvester = null; if (type == "Sonic") { newHarvester = new SonicHarvester(id, oreOutput, energyRequirement, sonicFactor); } else if (type == "Hammer") { newHarvester = new HammerHarvester(id, oreOutput, energyRequirement); } return(newHarvester); }
private void StartInit() { if (fieldPoints.Count == 0) { for (int i = 0; i < pointsCount; i++) { fieldPoints.Add(Instantiate(fieldPointPrefab, fieldTransform.position, fieldTransform.rotation, fieldTransform).GetComponent <FieldPointController>()); fieldPoints[i].Hide(); } } harvester = Instantiate(harvesterPrefab, startPoint.position, startPoint.rotation, transform).GetComponent <Harvester>(); FieldPointTriggerController.PlantOk += CorrectPlants; PlantController.HidePlantAction += LevelEstimation; FieldPointController.ThiefAction += LevelEstimation; }
public string RegisterHarvester(List <string> arguments) { string type = arguments[0]; string id = arguments[1]; try { Harvester harvester = HarvesterFactory.CreateHarvester(arguments); this.harvesters.Add(id, harvester); return($"Successfully registered {type} Harvester - {id}"); } catch (ArgumentException ae) { return(ae.Message); } }
public string RegisterHarvester(List <string> arguments) { string typeHarvester = arguments[0]; string id = arguments[1]; try { Harvester harvester = this.harvesterFactory.GetHarvester(arguments); this.registeredHarvesters.Add(harvester); return($"Successfully registered {typeHarvester} Harvester – {id}"); } catch (ArgumentException error) { return(error.Message); } }
public string Check(List <string> arguments) { string id = arguments[0]; Provider provider = this.providers.FirstOrDefault(x => x.Id == id); if (provider == null) { Harvester harvester = this.harvesters.FirstOrDefault(x => x.Id == id); if (harvester == null) { throw new ArgumentException($"No element found with id - {id}"); } return(harvester.ToString()); } return(provider.ToString()); }
public string RegisterHarvester(List <string> arguments) { string type = arguments[0]; string id = arguments[1]; try { Harvester newHarvester = this.MakeHarvester(arguments); harvestors.Add(id, newHarvester); return($"Successfully registered {type} Harvester - {id}"); } catch (Exception e) { return(e.Message); } }
public string RegisterHarvester(List <string> arguments) { string harvesterType = arguments[0]; string id = arguments[1]; try { Harvester harvester = this.harvesterFactory.GetHarvester(arguments); this.harvesters.Add(harvester); return($"Successfully registered {harvesterType} Harvester - {id}"); } catch (ArgumentException e) { return(e.Message); } }
static void MakeArtifacts() { //var types = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Namespace.StartsWith("DiscipleClan.Artifacts") && !t.Name.Contains("<>")); //foreach (var relic in types) { API.Log(BepInEx.Logging.LogLevel.All, "Artifact Name: " + relic.Name); Make(relic); } BarbedDefense.Make(); Harvester.Make(); ImprovedEngine.Make(); IronPlate.Make(); JunkRepairDrone.Make(); MiniFactory.Make(); OilSpill.Make(); Overdrive.Make(); Recycler.Make(); VanguardsEmblem.Make(); }
public string RegisterHarvester(List <string> arguments) { string type = arguments[0]; string id = arguments[1]; try { Harvester harvester = HarvesterFactory.CreateHarvest(arguments); harvesters.Add(harvester); } catch (ArgumentException argEx) { return($"Harvester is not registered, because of it's {argEx.Message}"); } return($"Successfully registered {type} Harvester - {id}"); }
public static void RemoveBarOfHarvester(Harvester harvester) { for (int i = 0; i < spawnedBars.Count; i++) { if (spawnedBars[i].harvester == harvester) { Destroy(spawnedBars[i].gameObject); spawnedBars.RemoveAt(i); return; } } }