public Excercise2() { InitializeComponent(); FlowerType ft = new FlowerType(); lvFlower.ItemsSource = ft.flowersType; }
public GroupListview() { InitializeComponent(); FlowerType flowerTypes = new FlowerType(); flowerList.ItemsSource = flowerTypes.FlowerTypes; }
//Update sprite med growtime? public void GetFlowerInformation(FlowerType flowerType) { switch (flowerType) { case FlowerType.Daisy: growTime = 6; x = 2; y = 3; z = 4; break; case FlowerType.Rose: growTime = 8; x = 2; y = 4; z = 6; break; case FlowerType.Tulip: growTime = 4; x = 0; y = 1; z = 2; break; case FlowerType.Violet: growTime = 5; x = 1; y = 2; z = 3; break; } }
/// <summary> /// 品种类型 /// </summary> /// <param name="ty"></param> /// <returns></returns> public static int InsertFlowerType(FlowerType ty) { string str = "insert into FlowerType values(@TypeName)"; SqlParameter[] p = { new SqlParameter("@TypeName", ty.TypeName) }; return(DbHelp.ExecuteNonQuary(str, p)); }
public Flower() { Type = FlowerType.Mixed; Color = FlowerColor.Mixed; Arrangement = FlowerArrangement.Vase; pc = 0.00M; }
public int Add(FlowerType type, int amt) { resDict[type] += amt; UpdateDisplay(type); EventManager.TriggerEvent(EventNames.HONEY_CHANGED); return(resDict[type]); }
public ListFlowerTypesViewModel() { data = new FlowerType(); LoadFlowerTypes(); AddFlowerType = new Command(Insert); UpdateFlowerType = new Command(Update, CanExe); DeleteFlowerType = new Command(Delete, CanExe); }
private void cmbType_SelectionChanged(object sender, SelectionChangedEventArgs e) { txtPrice.Text = cmbType.SelectedValue.ToString(); KeyValuePair <FlowerType, double> selectedEntry = (KeyValuePair <FlowerType, double>)cmbType.SelectedItem; selectedFlower = selectedEntry.Key; }
public void initSprites(Player player) { this.type = player.FlowerType; this.aliveSprite.Texture = player.AliveTexture; this.aliveSprite.AnimationManager.State = AnimationState.PlayForwardOnce; this.activeSprite = this.aliveSprite; this.dyingSprite.Texture = player.DyingTexture; }
public Flower(FlowerType type, FlowerColor color, FlowerArrangement argn, decimal price) { Type = type; Color = color; Arrangement = argn; pc = price; }
public Flower(Gene[][] genesPoss, Fraction[] genesProbs, FlowerType type, FlowerColour colour) { this.genesPoss = genesPoss; this.genesProbs = genesProbs; this.type = type; this.colour = colour; Validate(); }
public MyFlower(FlowerType flower, Gene aa1, Gene aa2, Gene aa3, Gene aa4 = Gene.Unknown) { type = flower; a1 = (int)aa1; a2 = (int)aa2; a3 = (int)aa3; a4 = (int)aa4; pairs = flower == FlowerType.Roses ? 4 : 3; }
public void SetSeed(Tuple <char, int, int> position, FlowerType flower, StemType stem) { using (var dbContext = new PlantTycoonContext()) { //var seed = dbContext.Seeds.FirstOrDefault(x => x.Position == position); var seed = new Seed(position, flower, stem); dbContext.Seeds.Add(seed); dbContext.SaveChanges(); } }
public AddFlowerViewModel() { flowerTypeRepository = new FlowerTypeRepository(); flowerRepository = new FlowerRepository(); flowerTypes = flowerTypeRepository.Gets(); flowers = flowerRepository.Gets(); flowerType = new FlowerType(); flower = new Flower(); AddFlower = new Command(Insert); }
public Route(string name, FlowerType type, int distance, int resources, int workerCapacity) { Name = name; Type = type; Distance = distance; Resources = resources; WorkerCapacity = workerCapacity; Depleted = false; Closed = false; }
public Flower(FlowerType flowerType, int timeToGrowInMinutes, int timeFlowerIsWateredInMinutes, bool canBeGrossPollunated, GameObject flowerPrefab, int positionInField) { _flowerType = flowerType; _timeToGrowInMinutes = timeToGrowInMinutes; _timeFlowerIsWateredInMinutes = timeFlowerIsWateredInMinutes; _canBeGrossPollunated = canBeGrossPollunated; FlowerPrefab = flowerPrefab; _positionInField = positionInField; }
public FlowerTypeViewModel() { flowerTypeRepository = new FlowerTypeRepository(); LoadFlowerTypes(); AddFlowerType = new Command(Insert); UpdateFlowerType = new Command(Update, CanExe); DeleteFlowerType = new Command(Delete, CanExe); SelectFlowerType = new Command(Select); flowerType = new FlowerType(); }
public void OnTriggerEnter(Collider other) { if (other.tag == "Flower") { FlowerType type = other.transform.parent.gameObject.GetComponent <Flower>().type; _pollen++; switch (type) { case FlowerType.POLLEN: _pollen += 2; break; case FlowerType.SHIELD: _isShield = true; break; case FlowerType.SPEED: speed = Mathf.Min(speed + 10, speed * 1.5f); break; } GameManager.currentScore = _pollen; if (_pollen >= GameManager.Instance.getScoreToReach()) { GameManager.distance = (int)transform.position.z; swipeControls.canSwipe = false; GameManager.instance.LoadLevel("end"); } } else if (other.tag == "Obstacle") { if (_isShield == true) { _isShield = false; } else { _pollen--; speed = speed / 2; if (_pollen < 0) { Died(); return; } } } scoreText.text = (_pollen).ToString() + " / " + GameManager.Instance.getScoreToReach().ToString(); gauge.fillAmount = (float)_pollen * 100.0f / (float)GameManager.Instance.getScoreToReach() / 100.0f; }
public int SaveFlowerType(FlowerType flowerType) { if (flowerType.id != 0) { return(_database.Update(flowerType)); } else { return(_database.Insert(flowerType)); } }
public async Task InsertFlowerType(FlowerType flowerType) { if (flowerType.FlowerTypeID == 0) { await _database.InsertAsync(flowerType); } else { await _database.UpdateAsync(flowerType); } }
public bool Remove(FlowerType type, int amt) { if (resDict[type] >= amt) { resDict[type] -= amt; UpdateDisplay(type); EventManager.TriggerEvent(EventNames.HONEY_CHANGED); return(true); } return(false); }
//one of the many ways to describe a sale public void PrintSale() { if (BucketType != BucketTypes.Single) { Console.WriteLine(date.ToString() + " : Bucket : " + BucketType.ToString() + " cost : " + cost.ToString()); } else { Console.WriteLine(date.ToString() + " : Flower : " + FlowerType.ToString() + " cost : " + cost.ToString()); } }
public FlowerTypeAndFlowerMasterDetailViewModel() { flowerTypeRepository = new FlowerTypeRepository(); flowerRepository = new FlowerRepository(); FlowerTypes = new ObservableCollection <FlowerType>(); FlowerTypes = flowerTypeRepository.Gets(); if (FlowerTypes.Count > 0) { FlowerTypeSelected = FlowerTypes[0]; } }
public List <FlowerFormula> ReportForFlowerType(FlowerType flowerType) { using (var dbContext = new PlantTycoonContext()) { var flowerFormulas = dbContext.FlowerFormulas .Where(x => x.FlowerA == flowerType || x.FlowerB == flowerType) .OrderBy(x => x.FlowerA.ToString()) .ThenBy(x => x.FlowerB.ToString()); return(flowerFormulas.ToList()); } }
public override string ToString() { if (Colors.Color1 == Colors.Color2) { return("Flower: " + FlowerType.ToString() + " SAME Color"); } else { return("Flower: " + FlowerType.ToString() + " NOT SAME Color"); } }
public Task <int> SaveFlowerTypeAsync(FlowerType flowerType) { if (flowerType.ID != 0) { return(_database.UpdateAsync(flowerType)); } else { return(_database.InsertAsync(flowerType)); } }
public Flower(string[] geneCodes, Fraction[] genesProbs, FlowerType type, FlowerColour colour) { //convert the string gene codes into arrays of Gene objects e.g. 210 to [Gene(TT), Gene(TF) , Gene(FF)]. genesPoss = geneCodes.Select(x => x.Select(g => new Gene(g)).ToArray()).ToArray(); this.genesProbs = genesProbs; this.type = type; this.colour = colour; Validate(); }
public void AddBundle(BundleManager.Bundle bundle) { GameObject newBundle = Instantiate(bundleListEntryPrefab, parentGroup.transform); newBundle.GetComponent <BundleListEntry>().SetBundle(bundle); FlowerType type = bundle.types[0]; if (bundle.types.All(t => t == type)) { newBundle.transform.SetAsLastSibling(); } }
private void Start() { FlowerType[] types = new FlowerType[4] { FlowerType.Common, FlowerType.Seasonal, FlowerType.Rare, FlowerType.Unique }; for (int n = 0; n < types.Length; n++) { BundleListManager.instance.AddBundle(GenerateGenericBundle(types[n])); } }
void AddHoneyOrder(FlowerType type) { if (autoOrderToggle.isOn) { return; } //Require that orders don't exceed nectar cost if (ResourceManager.Nectar(type) >= ((orders[type] + 1) * ControlManager.instance.Quantities.NectarPerHoney)) { orders[type]++; UpdateOrdersDisplay(); } }