public void FindMinerals(ResourcePatch mineral) { ChildInvokeNewLocation(mineral.MiningPoint); _minerals = mineral; mineral.AddToQueue(this); _headquarters = mineral.NearestHQ; OnMining?.Invoke(mineral); }
private void Awake() { PropertyPatch.PatchAll(); RegistryPatch.PatchAll(); ServicePatch.PatchAll(); CompendiumPatch.PatchAll(); ModPatch.PatchAll(); ResourcePatch.PatchAll(); RefinementPatch.PatchAll(); OverwriteOrAddPatch.PatchAll(); GreatWorkAPI.RegisterCurrentAssembly(); }
private void StopMining() { if (_isMining) { _isMining = false; } if (_minerals != null) { _minerals.RemoveFromQueue(this); _minerals.StopMining(); _minerals = null; } //if _gas }
public virtual Response <VMwareHost> Update(ResourcePatch body = null, CancellationToken cancellationToken = default) { using var scope = _vMwareHostHostsClientDiagnostics.CreateScope("VMwareHost.Update"); scope.Start(); try { var response = _vMwareHostHostsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); return(Response.FromValue(new VMwareHost(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <Response <VMwareCluster> > UpdateAsync(ResourcePatch body = null, CancellationToken cancellationToken = default) { using var scope = _vMwareClusterClustersClientDiagnostics.CreateScope("VMwareCluster.Update"); scope.Start(); try { var response = await _vMwareClusterClustersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); return(Response.FromValue(new VMwareCluster(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <VMwareDatastoreResource> Update(ResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); using var scope = _vMwareDatastoreDatastoresClientDiagnostics.CreateScope("VMwareDatastoreResource.Update"); scope.Start(); try { var response = _vMwareDatastoreDatastoresRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); return(Response.FromValue(new VMwareDatastoreResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <VMwareClusterResource> > UpdateAsync(ResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); using var scope = _vMwareClusterClustersClientDiagnostics.CreateScope("VMwareClusterResource.Update"); scope.Start(); try { var response = await _vMwareClusterClustersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); return(Response.FromValue(new VMwareClusterResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <ScVmmCloudResource> Update(WaitUntil waitUntil, ResourcePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); using var scope = _scVmmCloudCloudsClientDiagnostics.CreateScope("ScVmmCloudResource.Update"); scope.Start(); try { var response = _scVmmCloudCloudsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); var operation = new ArcScVmmArmOperation <ScVmmCloudResource>(new ScVmmCloudOperationSource(Client), _scVmmCloudCloudsClientDiagnostics, Pipeline, _scVmmCloudCloudsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }