protected string MakeRow(Produce produce) { var cells = new List<String>(13); if (produce.InSeasonForMonth(MarketDay.Month)) { cells.Add(String.Format("<td class=\"{1}\">{0}</td>", produce.Name, "inseason")); } else { cells.Add(String.Format("<td>{0}</td>", produce.Name)); } for (int month = 1; month <= 12; month++) { string className = (MarketDay.Month == month) ? "current " : String.Empty; if (produce.InSeasonForMonth(month)) { cells.Add(String.Format("<td class=\"{0} available\" title=\"{1}\"> </td>", className, new DateTime(DateTime.Today.Year, month, 1).ToString("MMMM"))); } else { cells.Add(String.Format("<td class=\"{0}\"> </td>", className)); } } return String.Join(String.Empty, cells.ToArray()); }
protected void Page_Load(object sender, EventArgs e) { //我这在后台模拟数据库数据 你看下 List<Produce> listp = new List<Produce>(); for (int i = 0; i < 6; i++) { Produce p = new Produce(); p.Id = i + 1; p.Pname = "厂家" + i + 1; p.Paddress = "厂家地址" + i; p.PPersong = "张三" + i; listp.Add(p); } List<Goods> listgoods = new List<Goods>(); for (int i = 0; i < 6; i++) { Goods g = new Goods(); g.goodsdecription = "ddd" + i; g.goodsnum = "goods" + i; g.goodsname = "goods" + i + "2"; g.Id = i + 1; //g.goodsPId = listp.Single(p => p.Id == 3).Paddress; listgoods.Add(g); } GridView1.DataSource = listgoods; GridView1.DataBind(); int u = 1; }
public static Pipe String(string contentType, Produce<string> stringPipe) { return (c0, next) => stringPipe(c0, (ctx, str) => { ctx.Response.ContentType = contentType; var sw = new StreamWriter(ctx.Response.Stream); sw.Write(str); sw.Close(); next(ctx); }); }
/// Action generator /// @todo Implement lookup table or a design pattern for easier/automatic function generation public void actionGenerator( List<GameObject[]> combinations ) { iThinkAction action; //printEverything(combinations); foreach ( GameObject[] matrix in combinations ) { switch ( schemaElements[0] ) { case "get" : action = new Get( "Get", matrix[0], matrix[1] ); tempActionList.Add(action); break; case "buy" : action = new Buy( "Buy", matrix[0], matrix[1], matrix[2] ); tempActionList.Add(action); break; case "store" : action = new Store( "Store", matrix[0], matrix[1]); tempActionList.Add(action); break; case "hunt" : action = new Hunt( "Hunt", matrix[0], matrix[1], matrix[2], matrix[3]); tempActionList.Add(action); break; case "make" : action = new Make( "Make", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "harvest" : action = new Harvest( "Harvest", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "produce" : action = new Produce( "Produce", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "craftSpell" : action = new CraftSpell ("CraftSpell", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; case "craftSimpleWeapon" : action = new CraftSimpleWeapon("CraftSimpleWeapon", matrix[0], matrix[1], matrix[2]); tempActionList.Add(action); break; } } }
public void SwitchProductionItem() { produce = ((produce==Produce.powerpack)? produce = Produce.resource : produce = Produce.powerpack); //fulfill the task of opening a facility's control panel if (HydroBot.gameMode == GameMode.MainGame && PlayGameScene.currentLevel == 0 && PlayGameScene.levelObjectiveState == 5 && produce == Produce.powerpack) { PlayGameScene.levelObjectiveState = 6; PlayGameScene.newLevelObjAvailable = true; } defaultChoice = produce; }
public void LoadContent(Game game, Vector3 position, float orientation,ref SpriteFont font,ref Texture2D backgroundTexture, List<Texture2D> animationTextures) { Position = position; BoundingSphere = CalculateBoundingSphere(); BoundingSphere scaledSphere; scaledSphere = BoundingSphere; scaledSphere.Radius *= GameConstants.FactoryBoundingSphereFactor; BoundingSphere = new BoundingSphere(scaledSphere.Center, scaledSphere.Radius); Vector3 tempCenter; tempCenter = BoundingSphere.Center; tempCenter.X = Position.X; tempCenter.Y = GameConstants.MainGameFloatHeight; tempCenter.Z = Position.Z; BoundingSphere = new BoundingSphere(tempCenter,BoundingSphere.Radius); this.orientation = orientation; this.animationTextures = animationTextures; if (animationTextures != null) { currentPartTexture = animationTextures[0]; } produce = defaultChoice; factoryFont = font; background = backgroundTexture; int rectWidth = (int)(graphicsDevice.Viewport.TitleSafeArea.Width); int rectHeight = (int)(graphicsDevice.Viewport.TitleSafeArea.Height); backgroundRect = new Rectangle(graphicsDevice.Viewport.TitleSafeArea.Center.X - rectWidth / 2, graphicsDevice.Viewport.TitleSafeArea.Center.Y - rectHeight / 2, rectWidth, rectHeight); produceRect = new Rectangle(backgroundRect.Center.X - 150, backgroundRect.Top + 120, 300, 65); SetUpgradeLevelDependentVariables(); this.game = game; // use construction state if (modelStates != null) { foreach (Model model in modelStates) { SetupShaderParameters(PoseidonGame.contentManager, model); } Model = modelStates[constructionIndex]; } else { //if (orientation > 50) floatUp = true; //else floatUp = false; // Set up the parameters underConstruction = false; SetupShaderParameters(PoseidonGame.contentManager, Model); } //EffectHelpers.GetEffectConfiguration(ref fogColor, ref ambientColor, ref diffuseColor, ref specularColor); }
public readonly Produce Produces; // what the building generates every "day" public Building(string name, int costMats, int costPower, int costPop, int upkeep, Building upgradesTo, Produce produces) { Name = name; CostMats = costMats; CostPower = costPower; CostPop = costPop; Upkeep = upkeep; UpgradesTo = upgradesTo; Produces = produces; }
public void Add(Produce item) { FDIDB.Produces.Add(item); }
public static Produce Create(String name, Int32 timeOfProduce, Int32 timeOfConsume) { Produce produce = new Produce(name, timeOfProduce, timeOfConsume); return(produce); }
public static Pipe File(string contentType, Produce<string> filenamePipe) { return (c0, next) => filenamePipe(c0, (ctx, filename) => renderFile(ctx, contentType, filename, next)); }
/// <summary> /// 布局蓝图的材料部分 /// </summary> /// <param name="tid">蓝图的TID</param> /// <param name="materialNode">材料节点</param> private void LayoutBlueprintMaterial(uint tid, Transform materialNode) { CfgEternityProxy cfg = GetConfig(); PackageProxy pack = GetPackage(); Produce produce = cfg.GetProduceByKey(tid); Transform materialList = FindComponent <Transform>(materialNode, "Resources"); TMP_Text materialTimeField = FindComponent <TMP_Text>(materialNode, "Label_Time"); materialTimeField.text = TableUtil.GetLanguageString("production_text_1024") + TimeUtil.GetTimeStr(produce.Time); int index = 0; int currencyIndex = 0; List <EffectElement?> sortedElements = new List <EffectElement?>(); if (produce.Cost > 0) { EffectElement?[] elements = cfg.GetEffectElementsByKey((uint)produce.Cost); if (elements.Length > 0) { for (int i = 0; i < elements.Length; i++) { EffectElement?element = elements[i]; Item item = cfg.GetItemByKey((uint)element.Value.ItemId); if (ItemTypeUtil.GetItemType(item.Type).MainType == Category.Currency) { sortedElements.Insert(currencyIndex, element); currencyIndex++; } else { sortedElements.Add(element); } } } for (; index < sortedElements.Count; index++) { EffectElement?element = sortedElements[index]; Item item = cfg.GetItemByKey((uint)element.Value.ItemId); Transform node = index < materialList.childCount ? materialList.GetChild(index) : UnityEngine.Object.Instantiate(materialList.GetChild(0), materialList); Image icon = FindComponent <Image>(node, "Icon/Icon"); Image quality = FindComponent <Image>(node, "Icon/Quality"); TMP_Text name = FindComponent <TMP_Text>(node, "Label_Name"); TMP_Text count = FindComponent <TMP_Text>(node, "Label_Num"); node.gameObject.SetActive(true); UIUtil.SetIconImageSquare(icon, item.Icon); long haveCount = pack.GetItemCountByTID((uint)element.Value.ItemId); long needCount = (long)element.Value.Value; quality.color = ColorUtil.GetColorByItemQuality(item.Quality); name.text = TableUtil.GetItemName(element.Value.ItemId); if (haveCount < needCount) { count.text = string.Format("<color=#ff0000>{0}</color>/{1}", haveCount, needCount); } else { count.text = string.Format("<color=#00ff00>{0}</color>/{1}", haveCount, needCount); } } } for (; index < materialList.childCount; index++) { materialList.GetChild(index).gameObject.SetActive(false); } }
public int Add(Produce u) { string Adds = $"insert into Produce Values({u.Proid},'{u.Proname}','{u.Proscdate}',{u.Pronum},'{u.Proyj}')"; return(DBHelper.ExecuteNonQuery(Adds)); }
public static Pipe Custom(UrlMappings mappings, Produce<string> pathFunc, Pipe on404) { return (c0, next) => pathFunc(c0, (ctx, path) => mappings.FindMapping(path, ifNotFound: on404)(ctx, next)); }
public int Add(Produce u) { return(_dal.Add(u)); }
public static Pipe String(Produce<string> stringPipe) { return String(Mime.Text.Plain, stringPipe); }
Task On(Produce x) => x.Stream.Push(x.Item);
public static Pipe File(Produce<string> filenamePipe) { return (c0, next) => filenamePipe(c0, (ctx, filename) => renderFile(ctx, Mime.FromFilename(filename), filename, next)); }