public Container(int weight, bool valuable, bool coolable) { Weight = SetWeigth(weight); Valuable = valuable; Coolable = coolable; Type = SetType(); }
/// <summary> /// Create a new container. /// </summary> /// <param name="type">The type of container</param> /// <param name="handler">The handler of the program</param> /// <param name="surface">The surface containing this container</param> /// <param name="parentContainer">This container's parent container</param> public Container(ContainerTypes type, Handler handler = null, RECT surface = new RECT(), Container parentContainer = null) { ParentContainer = parentContainer; MainHandler = handler; this.type = type; this.surface = surface; }
public void FilterData(StringBuilder res = null) { if (DisableBaseFilterData) { return; } if (res == null) { res = GetAutoPropertyFilterString(); } if (res.Length == 0 && vloader.NavigationExpression.Count != 0) { res.Append("&& All"); } if (res.Length > 0) { vloader.FilterExpression = res.ToString().Trim().Substring(2).Trim(); } else { if (vloader.FilterExpression != "All") { vloader.FilterExpression = null; } } ContainerTypes.Refresh(); NotifyPropertyChanged(x => this.ContainerTypes); }
public ActionResult DeleteConfirmed(Guid id) { ContainerTypes containerTypes = db.ContainerTypes.Find(id); db.ContainerTypes.Remove(containerTypes); db.SaveChanges(); return(RedirectToAction("Index")); }
public override bool IsSatisfied(Shipment shipment) { if (!ContainerTypes.ToList().Contains(shipment.ContainerType)) { return(true); } return(shipment.WeightPounds <= MaxWeightPerUnit); }
public Container(string description, ContainerTypes type) { _containers = new List <Container>(); _tests = new List <Test>(); this.Description = description; this.ContainerType = type; }
/// <summary> /// 容器 /// </summary> /// <param name="tran">容器位置</param> /// <param name="capacity">容量</param> /// <param name="direction">方向 +1 向左排 -1 向右排</param> /// <param name="type">容器类型</param> public Container(Transform tran, int capacity, int direction = -1, ContainerTypes type = ContainerTypes.Nomal) { this.direction = direction; this.capacity = capacity; this.type = type; transform = tran; childrenList = new List <MahjongPrefab>(); itemnPoint = tran.position; }
/// <summary> /// Create a new instance /// </summary> /// <param name="containerType">See <see cref="ContainerType" /></param> /// <param name="description">See <see cref="Description" /></param> /// <param name="displayName">See <see cref="DisplayName" /></param> /// <param name="highLevelType">See <see cref="HighLevelType" /></param> /// <param name="key">See <see cref="Key" /></param> /// <param name="isPrimaryKey">See <see cref="IsPrimaryKey" /></param> public Field(ContainerTypes containerType, string description, string displayName, string highLevelType, string key, bool isPrimaryKey) { ContainerType = containerType; Description = description; DisplayName = displayName; HighLevelType = highLevelType; Key = key; IsPrimaryKey = isPrimaryKey; }
// Constructor. public ContainerObject(BayObject _bay, int _row, int _tier) { this.Name = generateContainerName(_bay, _row, _tier); this.BayObject = _bay; this.Bay = Convert.ToInt16(_bay.Id); this.Row = _row; this.Tier = _tier; this.BayNumberString = _bay.Id; this.ContainerType = (_bay.GetNumber() % 2 == 0) ? ContainerTypes.Big : ContainerTypes.Small; this.Visible = false; }
// GET: ContainerTypes/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ContainerTypes containerTypes = db.ContainerTypes.Find(id); if (containerTypes == null) { return(HttpNotFound()); } return(View(containerTypes)); }
public override IEnumerable <IValidationError> IsValid() { if (ContainerTypes.IsNullOrEmpty()) { yield return(new ValidationError( "You must specify at least one container type")); } if (MaxWeightPerUnit <= 0) { yield return(new ValidationError( "MaxWeightPerUnit must be greater than zero", criterionName: () => MaxWeightPerUnit)); } }
/// <summary> /// Gets icon for a container object, such as the wagon. /// </summary> /// <param name="type">Container type.</param> /// <returns>ImageData.</returns> public ImageData GetContainerImage(ContainerTypes type) { // Get existing icon if in cache if (containerImages.ContainsKey(type)) { return(containerImages[type]); } // Load image data ImageData data = ImageReader.GetImageData(containerIconsFilename, (int)type, 0, true, true); // Add to cache containerImages.Add(type, data); return(data); }
public ActionResult Create([Bind(Include = "Name,Description")] ContainerTypes containerTypes) { if (ModelState.IsValid) { containerTypes.ContainerTypeID = Guid.NewGuid(); containerTypes.DateCreated = DateTime.Now; containerTypes.DateModified = containerTypes.DateCreated; containerTypes.CreatedBy = Guid.Parse(User.Identity.GetUserId()); // tole je za userID containerTypes.ModifiedBy = containerTypes.CreatedBy; db.ContainerTypes.Add(containerTypes); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(containerTypes)); }
public ActionResult Edit([Bind(Include = "ContainerTypeID,Name,Description")] ContainerTypesViewModel ContainerTypesViewModel) { if (ModelState.IsValid) { ContainerTypes model = db.ContainerTypes.Find(ContainerTypesViewModel.ContainerTypeID); model.Name = ContainerTypesViewModel.Name; model.Description = ContainerTypesViewModel.Description; model.DateModified = DateTime.Now; model.ModifiedBy = Guid.Parse(User.Identity.GetUserId()); db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ContainerTypesViewModel)); }
private LogHierarchyEntry CreateHierarchyStructure(List <LogEntry> entries) { LogHierarchyEntry root = new LogHierarchyEntry(new LogEntry() { TaskType = "ROOT" }); var currentParent = root; var currentList = root.Children; foreach (LogEntry entry in entries) { if (ContainerTypes.Contains(entry.TaskType.ToLower()) && entry.TaskAction == "START") { var newEntry = new LogHierarchyEntry(entry) { Parent = currentParent }; currentList.Add(newEntry); currentParent = newEntry; currentList = newEntry.Children; } else if (ContainerTypes.Contains(entry.TaskType.ToLower()) && entry.TaskAction == "END") { currentParent = currentParent.Parent; currentList = currentParent.Children; } else if (entry.TaskAction == "START" || entry.TaskAction == "LOG") { var hierarchyEntry = new LogHierarchyEntry(entry) { Parent = currentParent }; currentList.Add(hierarchyEntry); } } return(root); }
public void GotoPokemon(IPokemon pokemon) { if (pokemon.PokeContainer == null || pokemon.ContainerIndex == -1) { gotoPokemon = null; return; } if (pokemon.PokeContainer.Type == ContainerTypes.Party) { if (containerMode != ContainerTypes.Party) { containerMode = ContainerTypes.Party; buttonParty.Content = (pokePC.Daycare != null ? "Show Daycare" : "Hide Party"); pokeBoxControlParty.Visibility = Visibility.Visible; pokeBoxControlParty.LoadBox(pokePC.Party, gameIndex); } pokeBoxControlParty.HighlightPokemon(pokemon); } else if (pokemon.PokeContainer.Type == ContainerTypes.Daycare) { if (containerMode != ContainerTypes.Daycare) { containerMode = ContainerTypes.Daycare; buttonParty.Content = (pokePC.GameType == GameTypes.XD ? "Show Purifier" : "Hide Daycare"); pokeBoxControlParty.Visibility = Visibility.Visible; pokeBoxControlParty.LoadBox(pokePC.Daycare, gameIndex); } pokeBoxControlParty.HighlightPokemon(pokemon); } else if (pokemon.PokeContainer.Type == ContainerTypes.Purifier) { containerMode = ContainerTypes.Purifier; buttonParty.Content = "Hide Purifier"; pokeBoxControlParty.ChamberIndex = ((XDPurificationChamber)pokemon.PokeContainer).ChamberNumber; pokeBoxControlParty.Visibility = Visibility.Visible; pokeBoxControlParty.LoadBox(((XDPokePC)pokePC).GetChamber(pokeBoxControlParty.ChamberIndex), gameIndex); pokeBoxControlParty.HighlightPokemon(pokemon); } else { containerMode = ContainerTypes.Box; buttonParty.Content = "Show Party"; pokeBoxControlParty.Visibility = Visibility.Hidden; boxIndex = (int)(pokemon.PokeContainer as IPokeBox).BoxNumber; pokePC.CurrentBox = boxIndex; pokeBoxControlMaster.LoadBox(GetWrappedBox(boxIndex + BoxOffset), gameIndex); for (int i = 0; i < slaves.Count; i++) { slaves[i].LoadBox(GetWrappedBox(boxIndex + i + 1 + BoxOffset), gameIndex); } if (BoxOffset == 0) { pokeBoxControlMaster.HighlightPokemon(pokemon); } else { slaves[-BoxOffset - 1].HighlightPokemon(pokemon); } } gotoPokemon = pokemon; }
private void HideParty() { pokeBoxControlParty.Visibility = Visibility.Hidden; buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; }
public void LoadUI(int newGameIndex = -2, int newRowIndex = -1) { if (gameIndex != -2 || rowIndex != -1) { loaded = false; if (newGameIndex != -2) { this.gameIndex = newGameIndex; } if (newRowIndex != -1) { this.rowIndex = newRowIndex; } this.comboBoxGame.SelectedGameIndex = this.gameIndex; this.comboBoxRows.SelectedIndex = this.rowIndex; loaded = true; gotoPokemon = null; pokeBoxControlMaster.UnhighlightPokemon(); } if (GameSave is ManagerGameSave) { this.pokePC = (GameSave as ManagerGameSave).GetPokePCRow(rowIndex); comboBoxRows.Visibility = Visibility.Visible; buttonParty.Visibility = Visibility.Hidden; } else { this.pokePC = GameSave.PokePC; comboBoxRows.Visibility = Visibility.Hidden; buttonParty.Visibility = Visibility.Visible; } if (pokePC == null) { this.pokeBoxControlMaster.UnloadBox(); foreach (PokeBoxControl slave in slaves) { slave.UnloadBox(); } return; } this.boxIndex = pokePC.CurrentBox; this.pokeBoxControlMaster.PokemonViewer = pokemonViewer; this.pokeBoxControlParty.PokemonViewer = pokemonViewer; if (this.pokePC.Party == null) { containerMode = ContainerTypes.Box; buttonParty.Content = "Show Party"; buttonParty.IsEnabled = false; pokeBoxControlParty.Visibility = Visibility.Hidden; } else { buttonParty.IsEnabled = true; if (containerMode == ContainerTypes.Purifier && pokePC.GameType != GameTypes.XD) { containerMode = ContainerTypes.Box; buttonParty.Content = "Show Party"; pokeBoxControlParty.Visibility = Visibility.Hidden; } else if (containerMode == ContainerTypes.Daycare && pokePC.GameType == GameTypes.XD) { buttonParty.Content = "Show Purifier"; } } RefreshUI(); }
public PlayerData(string UiStyle, ContainerTypes Containers) { Enabled = true; this.UiStyle = UiStyle; this.Containers = Containers; }
private void OnPartyButtonClicked(object sender, RoutedEventArgs e) { if (containerMode == ContainerTypes.Box) { containerMode = ContainerTypes.Party; pokeBoxControlParty.Visibility = Visibility.Visible; if (pokePC.Daycare != null) buttonParty.Content = "Show Daycare"; else buttonParty.Content = "Hide Party"; } else if (containerMode == ContainerTypes.Party) { if (pokePC.Daycare != null) { if (pokePC.GameType == GameTypes.XD) buttonParty.Content = "Show Purifier"; else buttonParty.Content = "Hide Daycare"; containerMode = ContainerTypes.Daycare; } else { buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; pokeBoxControlParty.Visibility = Visibility.Hidden; } } else if (containerMode == ContainerTypes.Daycare) { if (pokePC.GameType == GameTypes.XD) { buttonParty.Content = "Hide Purifier"; containerMode = ContainerTypes.Purifier; } else { buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; pokeBoxControlParty.Visibility = Visibility.Hidden; } } else { pokeBoxControlParty.Visibility = Visibility.Hidden; buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; } if (containerMode == ContainerTypes.Party) pokeBoxControlParty.LoadBox(pokePC.Party, gameIndex); else if (containerMode == ContainerTypes.Daycare) pokeBoxControlParty.LoadBox(pokePC.Daycare, gameIndex); else if (containerMode == ContainerTypes.Purifier) pokeBoxControlParty.LoadBox(((XDPokePC)pokePC).GetChamber(0), gameIndex); }
public void LoadUI(int newGameIndex = -2, int newRowIndex = -1) { if (gameIndex != -2 || rowIndex != -1) { loaded = false; if (newGameIndex != -2) this.gameIndex = newGameIndex; if (newRowIndex != -1) this.rowIndex = newRowIndex; this.comboBoxGame.SelectedGameIndex = this.gameIndex; this.comboBoxRows.SelectedIndex = this.rowIndex; loaded = true; gotoPokemon = null; pokeBoxControlMaster.UnhighlightPokemon(); } if (GameSave is ManagerGameSave) { this.pokePC = (GameSave as ManagerGameSave).GetPokePCRow(rowIndex); comboBoxRows.Visibility = Visibility.Visible; buttonParty.Visibility = Visibility.Hidden; } else { this.pokePC = GameSave.PokePC; comboBoxRows.Visibility = Visibility.Hidden; buttonParty.Visibility = Visibility.Visible; } if (pokePC == null) { this.pokeBoxControlMaster.UnloadBox(); foreach (PokeBoxControl slave in slaves) slave.UnloadBox(); return; } this.boxIndex = pokePC.CurrentBox; this.pokeBoxControlMaster.PokemonViewer = pokemonViewer; this.pokeBoxControlParty.PokemonViewer = pokemonViewer; if (this.pokePC.Party == null) { containerMode = ContainerTypes.Box; buttonParty.Content = "Show Party"; buttonParty.IsEnabled = false; pokeBoxControlParty.Visibility = Visibility.Hidden; } else { buttonParty.IsEnabled = true; if (containerMode == ContainerTypes.Purifier && pokePC.GameType != GameTypes.XD) { containerMode = ContainerTypes.Box; buttonParty.Content = "Show Party"; pokeBoxControlParty.Visibility = Visibility.Hidden; } else if (containerMode == ContainerTypes.Daycare && pokePC.GameType == GameTypes.XD) { buttonParty.Content = "Show Purifier"; } } RefreshUI(); }
public void GotoPokemon(IPokemon pokemon) { if (pokemon.PokeContainer == null || pokemon.ContainerIndex == -1) { gotoPokemon = null; return; } if (pokemon.PokeContainer.Type == ContainerTypes.Party) { if (containerMode != ContainerTypes.Party) { containerMode = ContainerTypes.Party; buttonParty.Content = (pokePC.Daycare != null ? "Show Daycare" : "Hide Party"); pokeBoxControlParty.Visibility = Visibility.Visible; pokeBoxControlParty.LoadBox(pokePC.Party, gameIndex); } pokeBoxControlParty.HighlightPokemon(pokemon); } else if (pokemon.PokeContainer.Type == ContainerTypes.Daycare) { if (containerMode != ContainerTypes.Daycare) { containerMode = ContainerTypes.Daycare; buttonParty.Content = (pokePC.GameType == GameTypes.XD ? "Show Purifier" : "Hide Daycare"); pokeBoxControlParty.Visibility = Visibility.Visible; pokeBoxControlParty.LoadBox(pokePC.Daycare, gameIndex); } pokeBoxControlParty.HighlightPokemon(pokemon); } else if (pokemon.PokeContainer.Type == ContainerTypes.Purifier) { containerMode = ContainerTypes.Purifier; buttonParty.Content = "Hide Purifier"; pokeBoxControlParty.ChamberIndex = ((XDPurificationChamber)pokemon.PokeContainer).ChamberNumber; pokeBoxControlParty.Visibility = Visibility.Visible; pokeBoxControlParty.LoadBox(((XDPokePC)pokePC).GetChamber(pokeBoxControlParty.ChamberIndex), gameIndex); pokeBoxControlParty.HighlightPokemon(pokemon); } else { containerMode = ContainerTypes.Box; buttonParty.Content = "Show Party"; pokeBoxControlParty.Visibility = Visibility.Hidden; boxIndex = (int)(pokemon.PokeContainer as IPokeBox).BoxNumber; pokePC.CurrentBox = boxIndex; pokeBoxControlMaster.LoadBox(GetWrappedBox(boxIndex + BoxOffset), gameIndex); for (int i = 0; i < slaves.Count; i++) slaves[i].LoadBox(GetWrappedBox(boxIndex + i + 1 + BoxOffset), gameIndex); if (BoxOffset == 0) pokeBoxControlMaster.HighlightPokemon(pokemon); else slaves[-BoxOffset - 1].HighlightPokemon(pokemon); } gotoPokemon = pokemon; }
private void OnPartyButtonClicked(object sender, RoutedEventArgs e) { if (containerMode == ContainerTypes.Box) { containerMode = ContainerTypes.Party; pokeBoxControlParty.Visibility = Visibility.Visible; if (pokePC.Daycare != null) { buttonParty.Content = "Show Daycare"; } else { buttonParty.Content = "Hide Party"; } } else if (containerMode == ContainerTypes.Party) { if (pokePC.Daycare != null) { if (pokePC.GameType == GameTypes.XD) { buttonParty.Content = "Show Purifier"; } else { buttonParty.Content = "Hide Daycare"; } containerMode = ContainerTypes.Daycare; } else { buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; pokeBoxControlParty.Visibility = Visibility.Hidden; } } else if (containerMode == ContainerTypes.Daycare) { if (pokePC.GameType == GameTypes.XD) { buttonParty.Content = "Hide Purifier"; containerMode = ContainerTypes.Purifier; } else { buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; pokeBoxControlParty.Visibility = Visibility.Hidden; } } else { pokeBoxControlParty.Visibility = Visibility.Hidden; buttonParty.Content = "Show Party"; containerMode = ContainerTypes.Box; } if (containerMode == ContainerTypes.Party) { pokeBoxControlParty.LoadBox(pokePC.Party, gameIndex); } else if (containerMode == ContainerTypes.Daycare) { pokeBoxControlParty.LoadBox(pokePC.Daycare, gameIndex); } else if (containerMode == ContainerTypes.Purifier) { pokeBoxControlParty.LoadBox(((XDPokePC)pokePC).GetChamber(0), gameIndex); } }
public static string UniqueElementName(ContainerTypes containerType, string parentElementName, string elementName) { return(instance.pluginName + containerType.ToString() + parentElementName + elementName); }
public Container3dDataGenerator(Point3D container_pos, ContainerTypes container_type) { this.container_pos = container_pos; this.container_type = container_type; }