public SharableResource(string name, IResourceSet owner, object value) { this.name = name; this.owner = owner; this.value = value; this.usersCount = 1; }
public DeviceInterface(Device device, CommonDeviceInterface cdi) { this.device = device; this.cdi = cdi; this.resourceSet = new ResourceSet(device); cdi.Resources.AddSet(resourceSet); }
private void Iter() { foreach (var obj1 in MobileObjects) { foreach (var obj2 in Objects) { if (obj1.Key == obj2.Key) { continue; } if (obj2.Value.Disable) { continue; } if (obj1.Value.GetPosition().Equal(obj2.Value.GetPosition())) { if (obj2.Value is IResourceSet) { IResourceSet temp = (IResourceSet)obj2.Value; Players[obj1.Value.GetOwnerID()].AddResources(temp.GetResources()); obj2.Value.Disable = true; //ObjectsByPosition.Remove(obj2.Key); } //obj1.Value.Interract(obj2.Value); } } } }
public void CollectResource(IResourceSet resource) { foreach (var res in resource.GetResources()) { resources[res.Key] += res.Value; } }
public DeviceInterface(Device device, CommonDeviceInterface cdi, HashTableSettings localSettings) { this.device = device; this.cdi = cdi; this.localSettings = localSettings; resourceSet = new ResourceSet(device); cdi.Resources.AddSet(resourceSet); }
public override void Interract(IModelObject modelObject) { if (modelObject is ICollectable) { if (modelObject is IResourceSet) { IResourceSet myTest = modelObject as IResourceSet; myTest.GetResources(); } } }
public void Interract(IMobile from, IResourceSet to) { if (to.Disable) { return; } else { Players[from.GetOwnerID()].AddResources(to.ExtractResources()); //ObjectsByPosition.Remove(to.GetID()); to.Disable = true; } }
public override void Draw(IResourceSet resourceSet, int elements) { if (resourceSet == null) { throw new ArgumentNullException(nameof(resourceSet)); } pipeline.Bind(); vertexArrayObject.Bind(); indexBuffer.Bind(); vertexArrayBuffer.Bind(); foreach (var uniform in resourceSet.GetUniforms()) { uniform.Set(pipeline); } indexBuffer.DrawIndexed(vertexArrayBuffer, elements); vertexArrayBuffer.Unbind(); indexBuffer.Unbind(); vertexArrayObject.Unbind(); pipeline.Unbind(); }
/// <summary> /// Constructs a nested resource set that filters the IDs of its parent resource set for a prefix. /// </summary> /// <param name="parent">Containing parent resource set</param> /// <param name="prefix">ID prefix used for filtering</param> public NestedResourceSet(IResourceSet parent, string prefix) { this.parent = parent; this.prefix = prefix; }
/// <summary> /// Constructs a combined resource set that looks up resources in the second set if they are not present in the first. /// </summary> /// <param name="first">First resource set</param> /// <param name="second">Second resource set, shadowed by <paramref name="first" /></param> public CombinedResourceSet(IResourceSet first, IResourceSet second) { this.first = first; this.second = second; }
public abstract void Draw(IResourceSet resourceSet);
public abstract void Draw(IResourceSet resourceSet, int elements);
public void AddSet(IResourceSet set) { resourceSets.Add(set.Key, set); }
#pragma warning restore CS8618 /// <summary> /// Helper function that sets up the test vector's resource sets. /// </summary> private void InitializeResourceSets() => inputFolderResources = allInputFolderResources.Nest($"{schemaName}.protoc-input/");
#pragma warning restore CS8618 private void InitializeResourceSets() { inputFolderResources = allInputFolderResources.Nest($"{name}.protoc-input/"); expectedOutputFolderResources = allExpectedOutputFolderResources.Nest($"{name}.protoc-output/"); }
public override void Draw(IResourceSet resourceSet) { Draw(resourceSet, elements); }