public BaseMaterial GetMaterialLink(int id, BaseDocument doc) { global::System.IntPtr cPtr = C4dApiPINVOKE.BaseContainer_GetMaterialLink(swigCPtr, id, BaseDocument.getCPtr(doc)); BaseMaterial ret = (BaseMaterial)C4dApiPINVOKE.InstantiateConcreteMaterial(cPtr, false); return(ret); }
internal RWMaterialProp(String name, BaseMaterial mat, Boolean useCache) { this.useCache = useCache; this.mat = mat; this.propName = name; this.cached = this.useCache ? this.mat.GetProperty <T>(name) : default; }
public BaseMaterial GetMaterial() { global::System.IntPtr cPtr = C4dApiPINVOKE.TextureTag_GetMaterial__SWIG_1(swigCPtr); BaseMaterial ret = (BaseMaterial)C4dApiPINVOKE.InstantiateConcreteMaterial(cPtr, false); return(ret); }
public ProduceMaterialOrder(int idPlayer, Building building) { this.idPlayer = idPlayer; this.building = building; this.baseMaterial = building.producedMaterial; this.timeCounter = 0; }
protected TriangleElement(SerializationInfo info, StreamingContext context) : base(info, context) { _material = (BaseMaterial)info.GetValue("_material", typeof(BaseMaterial)); _section = (Base2DSection)info.GetValue("_section", typeof(Base2DSection)); _behavior = (TriangleElementBehaviour)info.GetInt32("_behavior"); _formulation = (MembraneFormulation)info.GetInt32("_behavior"); }
public new static BaseMaterial Alloc(int type) { global::System.IntPtr cPtr = C4dApiPINVOKE.BaseMaterial_Alloc(type); BaseMaterial ret = (BaseMaterial)C4dApiPINVOKE.InstantiateConcreteMaterial(cPtr, false); return(ret); }
/// <summary> /// Create an YnMeshModel with an YnModel and a material. /// </summary> /// <param name="model">An YnModel instance</param> /// <param name="material">A material</param> public YnMeshModel(string modelName, BaseMaterial material) : this() { _model = null; _modelName = modelName; _material = material; }
/// <summary> /// Create an YnMeshModel with a model loaded from content manager and a material. /// </summary> /// <param name="model">A Model instance</param> /// <param name="material">A material</param> public YnMeshModel(Model model, BaseMaterial material) : this() { _model = model; _material = material; _modelName = _model.ToString(); }
public BaseMaterial GetActiveMaterial() { global::System.IntPtr cPtr = C4dApiPINVOKE.BaseDocument_GetActiveMaterial(swigCPtr); BaseMaterial ret = (BaseMaterial)C4dApiPINVOKE.InstantiateConcreteMaterial(cPtr, false); return(ret); }
void SetCustomGpuParameter(VegetationGpuParameters parameter, Vec4 value) { for (int nMaterial = 0; nMaterial < 4; nMaterial++) { Material material = null; switch (nMaterial) { case 0: material = BaseMaterial; break; case 1: material = BaseMaterial.GetShadowTextureCasterMaterial(RenderLightType.Point); break; case 2: material = BaseMaterial.GetShadowTextureCasterMaterial(RenderLightType.Directional); break; case 3: material = BaseMaterial.GetShadowTextureCasterMaterial(RenderLightType.Spot); break; } if (material == null) { continue; } foreach (Technique technique in material.Techniques) { foreach (Pass pass in technique.Passes) { if (pass.VertexProgramParameters != null || pass.FragmentProgramParameters != null) { if (pass.VertexProgramParameters != null) { if (!pass.IsCustomGpuParameterInitialized((int)parameter)) { pass.VertexProgramParameters.SetNamedAutoConstant(parameter.ToString(), GpuProgramParameters.AutoConstantType.Custom, (int)parameter); } } if (pass.FragmentProgramParameters != null) { if (!pass.IsCustomGpuParameterInitialized((int)parameter)) { pass.FragmentProgramParameters.SetNamedAutoConstant(parameter.ToString(), GpuProgramParameters.AutoConstantType.Custom, (int)parameter); } } pass.SetCustomGpuParameter((int)parameter, value); } } } } }
/// <summary> /// Gets material used by the model. /// </summary> /// <returns>An array of material used by the model.</returns> public BaseMaterial[] GetModelMaterial() { List <BaseMaterial> materials = new List <BaseMaterial>(); BaseMaterial material = null; foreach (ModelMesh mesh in _model.Meshes) { foreach (ModelMeshPart part in mesh.MeshParts) { material = new BasicMaterial(); var effect = part.Effect as BasicEffect; if (effect != null) { material.Texture = effect.Texture; material.Effect = effect; } materials.Add(material); } } return(materials.ToArray()); }
public static int InsertBaseMaterial(BaseMaterial bm) { int isInsert = 0; try { string query = SQLClass.INSERT_INTO_BASEMATERIAL; NpgsqlCommand command = new NpgsqlCommand(query); command.CommandType = CommandType.Text; command.Parameters.Add("matcode", bm.Matcode); command.Parameters.Add("description", bm.Description); command.Parameters.Add("orderdescription", bm.OrderDescription); command.Parameters.Add("suppcode", bm.SuppCode); command.Parameters.Add("prjcode", bm.PrjCode); command.Parameters.Add("edmcode", bm.EdmCode); command.Parameters.Add("unit", bm.Unit); command.Parameters.Add("packunit", bm.PackUnit); command.Parameters.Add("purchaseprice", bm.PurchasePrice); command.Parameters.Add("discount1", bm.Discount1); command.Parameters.Add("discount2", bm.Discount2); command.Parameters.Add("freight", bm.Freight); command.Parameters.Add("addon1", bm.Addon1); command.Parameters.Add("addon2", bm.Addon2); command.Parameters.Add("netprice", bm.NetPrice); command.Parameters.Add("sellprice", bm.SellPrice); command.Parameters.Add("sellperfect", bm.SellPerfect); command.Parameters.Add("orderdate", bm.OrderDate); command.Parameters.Add("deliverydate", bm.DeliveryDate); command.Parameters.Add("instock", bm.InStock); command.Parameters.Add("minstock", bm.MinStock); command.Parameters.Add("maxstock", bm.MaxStock); command.Parameters.Add("minorder", bm.MinOrder); command.Parameters.Add("stockloc", bm.StockLoc); command.Parameters.Add("sparepart", bm.SparePart); command.Parameters.Add("webshop", bm.WebShop); command.Parameters.Add("remark", bm.Remark); command.Parameters.Add("mergecode", bm.MergeCode); command.Parameters.Add("derivedfrom", bm.DerivedFrom); command.Parameters.Add("remarkeng", bm.RemarkEng); command.Parameters.Add("keywords", bm.KeyWords); command.Parameters.Add("filter1", bm.Filter1); command.Parameters.Add("filter2", bm.Filter2); command.Parameters.Add("filter3", bm.Filter3); command.Parameters.Add("filter4", bm.Filter4); command.Parameters.Add("filter5", bm.Filter5); command.Parameters.Add("new_suppcode", bm.NewSuppCode); command.Parameters.Add("cust_code", bm.CustCode); command.Parameters.Add("matcode_suppl", bm.MatcodeSuppl); command.Parameters.Add("deleted", bm.Deleted); IDatabaseFactory dbFactory = new DatabaseFactory(); IDatabase dbObject = dbFactory.CreateDatabaseInstance(ACTIVE_DATABASE); isInsert = dbObject.ExecuteQuery(command); } catch (Exception ex) { Hey.Common.Utils.LogWriter.Log(ex.Message); } return(isInsert); }
public void ShowToolTipMaterial(BaseMaterial material) { anim.SetTrigger("Show"); Name.text = material.Name; Consumes.text = "- Material"; Produces.text = "-"; }
/// <summary> /// Create an YnMeshGeometry with a geometry and a material. /// </summary> /// <param name="geometry">Geometry to use.</param> /// <param name="material">Material to use with geometry.</param> public YnMeshGeometry(BaseGeometry <VertexPositionNormalTexture> geometry, BaseMaterial material) : base() { _geometry = geometry; _material = material; _worldMatrixIsMaster = false; }
void DoOutput() { foreach (var item in space.Buildings) { if ((item.Output.ConsumeToGo == 0 && item.Output.TimeToGo == 0) || (!item.Input.enabled && item.Output.TimeToGo == 0)) { //Debug.Log("should do output"); SimpleCords spawnlocation = item.CenterLocation.OffsetBy(item.Output.DeliveryLocation); string materialName = item.Output.MaterialName; Tile t = space.Map.SaveGet(spawnlocation.x, spawnlocation.z); if (t.occupation == TileOccupation.Empty) { BaseMaterial mat = materials.GetMaterialByName(materialName); space.SpawnMaterial(mat, spawnlocation); if (item.Input.enabled) { item.Output.ConsumeToGo = item.Output.ConsumeAmount; item.Input.ConsumeToGo = item.Input.ConsumeAmount; item.Output.TimeToGo = -1; } else { item.Output.TimeToGo = item.Output.DeliverTimer; } item.Clock.SetTimer(item.Output.TimeToGo); } item.Clock.SetTimer(item.Output.TimeToGo); } } ReportDone(); }
public new BaseMaterial GetPred() { global::System.IntPtr cPtr = C4dApiPINVOKE.BaseMaterial_GetPred(swigCPtr); BaseMaterial ret = (BaseMaterial)C4dApiPINVOKE.InstantiateConcreteMaterial(cPtr, false); return(ret); }
/// <summary> /// a tile needs its location for information, it automatically start empty /// </summary> /// <param name="position">position of the tile</param> public Tile(SimpleCords position) { this.position = position; Building = null; Material = null; occupation = TileOccupation.Empty; }
private void DropMaterial() { if (isHolding) { moveState = MoveState.Return; bool contains = false; for (int i = 0; i < possiblePositions.Count; i++) { if (possiblePositions[i].Equals(holdPosition)) { contains = true; } } //Debug.Log("contains"); MoveMaterial(originLocation, holdPosition, heldMaterial); // return to new location ObjectsToReturn.RemoveAll((x) => x.Key == heldMaterial.GameObject); ObjectsToReturn.Add(new KeyValuePair <GameObject, Vector3>(heldMaterial.GameObject, new Vector3(0, 0.50f, 0) + (Vector3)holdPosition)); heldMaterial = null; isHolding = false; holdTime = 0f; HidePossiblePositions(); } }
protected override void OnClearBaseMaterial() { //clear material BaseMaterial.RemoveAllTechniques(); base.OnClearBaseMaterial(); }
public MaterialSource(string name, GameObject model, BaseMaterial baseMaterial, long quantityTotal) : base(name, model) { this.baseMaterial = baseMaterial; this.quantityTotal = quantityTotal; this.quantity = quantityTotal; this.canBuild = true; this.building = null; }
/// <summary> /// use this with unplaced Objects /// </summary> /// <param name="material">the material</param> /// <param name="location">position of placement</param> public void SpawnMaterial(BaseMaterial material, SimpleCords location) { Map[location.x, location.z].Material = material; Map[location.x, location.z].occupation = TileOccupation.Material; material.Place(location); Materials.Add(material); }
protected HexahedralElement(SerializationInfo info, StreamingContext context) : base(info, context) { _e = (double)info.GetValue("_e", typeof(double)); _nu = (double)info.GetValue("_nu", typeof(double)); _massDensity = (double)info.GetValue("_massDensity", typeof(double)); _material = (BaseMaterial)info.GetValue("_material", typeof(int)); }
protected BarElement(SerializationInfo info, StreamingContext context) : base(info, context) { _webRotation = (double)info.GetValue("_webRotation", typeof(double)); _material = (BaseMaterial)info.GetValue("_material", typeof(BaseMaterial)); _behavior = (BarElementBehaviour)info.GetValue("_behavior", typeof(int)); _section = (Base1DSection)info.GetValue("_section", typeof(Base1DSection)); _nodalReleaseConditions = (Constraint[])info.GetValue("_nodalReleaseConditions", typeof(Constraint[])); }
void CreateFixedPipelineTechnique() { Technique tecnhique = BaseMaterial.CreateTechnique(); Pass pass = tecnhique.CreatePass(); pass.NormalizeNormals = true; pass.CreateTextureUnitState(ConvertToFullPath(DiffuseMap)); }
public BaseMaterial[] GetMaterials() { BaseMaterial[] materials = new BaseMaterial[6]; for (int i = 0; i < 6; i++) { materials[i] = (this[i] as YnMesh).Material; } return(materials); }
public Building Instantiate() { BaseMaterial producedBaseMaterial = null; if (producedMaterial != null) { producedBaseMaterial = producedMaterial.Instantiate(); } return(new Building(id, name, Resources.Load(icon, typeof(Sprite)) as Sprite, Resources.Load(model, typeof(GameObject)) as GameObject, units, technologies, cost, size, lifeTotal, developTime, constructed, visionField, requireds, producedBaseMaterial, producedPerTime)); }
public BaseMaterial SearchMaterialInc(string /* constString&_cstype */ str) { global::System.IntPtr cPtr = C4dApiPINVOKE.BaseDocument_SearchMaterialInc(swigCPtr, str); BaseMaterial ret = (BaseMaterial)C4dApiPINVOKE.InstantiateConcreteMaterial(cPtr, false); if (C4dApiPINVOKE.SWIGPendingException.Pending) { throw C4dApiPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
protected virtual void DrawUserIndexedPrimitives(GraphicsDevice device, BaseMaterial material) { PreDraw(device); foreach (EffectPass pass in material.Effect.CurrentTechnique.Passes) { pass.Apply(); device.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, _vertices, 0, _vertices.Length, _indices, 0, _indices.Length / 3); } PostDraw(device); }
public IShield CreateShield(int level, BaseMaterial material = null) { IShield shield = new Shield(); shield.Id = ItemId++; shield.Zone = Zone.Id; shield.Level = level; shield.Dice = GlobalReference.GlobalValues.DefaultValues.DiceForArmorLevel(level); shield.Material = material; return(shield); }
//public MaterialSource targetSource; public Worker(int idType, string name, Sprite icon, GameObject model, Dictionary <int, int> cost, float attack, float defense, float walkSpeed, float lifeTotal, int capacityTotal, float collectSpeed, List <int> buildings, float range, float attackSpeed, float trainingTime, int visionField) : base(idType, name, icon, model, cost, attack, defense, walkSpeed, lifeTotal, range, attackSpeed, trainingTime, visionField) { this.capacity = 0; this.capacityTotal = capacityTotal; this.collectSpeed = collectSpeed; this.requiredBuilding = null; this.buildings = buildings; //this.targetBuilding = null; this.collectTimeCounter = 0.0f; this.materialType = null; //this.targetSource = null; }