public void PrintMenu(IIterator <string> iterator) { while (iterator.HasNext()) { string menuItem = iterator.Next(); Console.WriteLine(menuItem); } }
private void IteratorPrinter(IIterator iterator) { while (iterator.HasNext()) { var menuItem = (MenuItem) iterator.Next(); Console.WriteLine(String.Format("Name={0} Description={1} Vege?={2} Price={3}", menuItem.Name, menuItem.Description, menuItem.Vegetarian, menuItem.Price)); } }
private void PrintMenu(IIterator iterator) { while (iterator.HasNext()) { var item = iterator.Next() as MenuItem; Console.WriteLine($"{item?.Name}, {item?.Price},{item?.Description}"); } }
public bool MoveNext() { gotCurrent = iterator.HasNext(); if (gotCurrent) { current = iterator.Next(); } return(gotCurrent); }
private void PrintMenu(IIterator iterator) { while (iterator.HasNext()) { MenuItem menuItem = iterator.Next(); Console.WriteLine($"{menuItem.Name}, {menuItem.Price.ToString(CultureInfo.InvariantCulture)} -- "); Console.WriteLine(menuItem.Description); } }
//通过迭代器读取评价数据 void ReadEvaluationAttribute() { mEvaluateIterator = SingletonGameData.GetInstance().CreateEvaluateIterator(); while (mEvaluateIterator.HasNext()) { EvaluationAttribute mEvaluationAttribute = (EvaluationAttribute)mEvaluateIterator.Next(); mListEvaluationAttribute.Add(mEvaluationAttribute); } }
public string GetContents() { System.Text.StringBuilder sbr = new System.Text.StringBuilder(1024); for (IIterator e = Elements(); e.HasNext();) { sbr.Append(e.Next().ToString()); } return(sbr.ToString()); }
public void ListMenus() { IIterator iterator = _allMenus.GetIterator(); while (iterator.HasNext()) { iterator.GetNext().Print(); } }
private void PrintMenu(IIterator iterator) //хз зачем, но надо { while (iterator.HasNext()) { MenuItem menuItem = iterator.Next(); Console.Write(menuItem.getName() + ", "); Console.Write(menuItem.getPrice() + "----"); Console.WriteLine(menuItem.getDescription() + ""); } }
private static void Iterate(IIterator <Menu> iterator) { while (iterator.HasNext()) { Menu menu = iterator.Next(); Console.WriteLine(menu.Name); Console.WriteLine(menu.Description); Console.WriteLine(menu.Price); } }
private void PrintMenu(IIterator iterator) { while (iterator.HasNext()) { MenuItem item = (MenuItem)iterator.Next(); Console.WriteLine(item.GetName()); Console.WriteLine("\t\t" + item.GetPrice()); Console.WriteLine("\t" + item.GetDescription()); } }
private void PrintMenu(IIterator iterator) { while (iterator.HasNext()) { MenuItem menuItem = (MenuItem) iterator.Next(); Console.Write(menuItem.Name + ", "); Console.Write(menuItem.Price + " -- "); Console.WriteLine(menuItem.Description); } }
private void _printingMenu(IIterator enumerator) { while (enumerator.HasNext()) { PositionMenu positionMenu = (PositionMenu)enumerator.Current; Console.WriteLine(positionMenu.GetName() + ", "); Console.WriteLine(positionMenu.GetPrice() + ", "); Console.WriteLine(positionMenu.GetDescription()); } }
public static void test() { NameRepository namesRepository = new NameRepository(); for (IIterator iter = namesRepository.GetIterator(); iter.HasNext();) { String name = (String)iter.Next(); Console.WriteLine("Name : " + name); } }
static void Main(string[] args) { NameRepository nameRepository = new NameRepository(); IIterator iter = nameRepository.Iterator(); while (iter.HasNext()) { Console.WriteLine((string)iter.Next()); } }
static void Main(string[] args) { NameRepository nameRepository = new NameRepository(); for (IIterator iterator = nameRepository.GetIterator(); iterator.HasNext();) { String name = iterator.Next() as String; Console.WriteLine("Name: " + name); } }
public bool MoveNext() { bool hasNext = enume.HasNext(); if (hasNext) { current = enume.Next(); } return(hasNext); }
public virtual void Clear() { IIterator <E> it = Iterator(); while (it.HasNext()) { it.Next(); it.Remove(); } }
public static List <T> IteratorToArray <T>(IIterator <T> enumerator) { var result = new List <T>(); while (enumerator.HasNext()) { result.Add(enumerator.Next()); } return(result); }
public void Clear() { IIterator e = Iterator(); while (e.HasNext()) { e.Next(); e.Remove(); } }
private void printMenu(IIterator iterator) { while (iterator.HasNext()) { MenuItem menuItem = iterator.Next(); Console.WriteLine(menuItem.GetName() + ", "); Console.WriteLine(menuItem.GetPrice() + " -- "); Console.WriteLine(menuItem.GetDescription()); } }
public void PrintMenu(IIterator menuIterator) { while (menuIterator.HasNext()) { MenuItem item = (MenuItem)menuIterator.Next(); Console.WriteLine(item.Name); Console.WriteLine(item.Description); Console.WriteLine(item.Vegetarian); Console.WriteLine(item.Price); } }
public static int Size(IIterator source) { int result = 0; while (source.HasNext()) { source.Next(); ++result; } return(result); }
private static void PrintMenu(IIterator <MenuItem> iterator) { while (iterator.HasNext()) { MenuItem menuItem = iterator.Next(); Console.Write(menuItem.Name + ", "); Console.Write(menuItem.Price + " -- "); Console.WriteLine(menuItem.Description); } }
private static void PrintMenu(IIterator <MenuItem> iterator) { while (iterator.HasNext()) { var menuItem = iterator.NextTo(); Console.WriteLine("==============================="); Console.Write(menuItem.GetName() + " - ("); Console.WriteLine(menuItem.GetPrice() + "$)"); Console.WriteLine(menuItem.GetDescription()); } }
public IEnumeratorAdapter(IIterator enume) { if (enume != null) { this.enume = enume; if (enume.HasNext()) { this.current = enume.Next(); } } }
static void Main(string[] args) { NameRepository nameRepository = new NameRepository(); IIterator iterator = nameRepository.GetIterator(); while (iterator.HasNext()) { string name = (string)iterator.Next(); Console.WriteLine("Name : " + name); } }
public void PrintMenu(IIterator iterator) { while (iterator.HasNext()) { var item = iterator.Next() as MenuItemInfo; if (item != null) { Console.WriteLine(item.Name + ", " + item.Price + ", " + item.Description); } } }
public Tuple <K, T> Next() { while (iterator == null || !iterator.HasNext()) { iterator = table[Index]?.GetIterator(); Index++; } return(iterator.Next()); }
private void _PrintMenus(IIterator iterator) { var log = ""; while (iterator.HasNext()) { MenuItem menu = (MenuItem)iterator.Next(); log = log + $"{menu.Name} (¥{menu.Price})\n"; } Debug.Log(log); }
static void Main(string[] args) { ConcreteAggregate agg = new ConcreteAggregate(); IIterator ite = agg.CreateIterator(); while (ite.HasNext()) { Console.Write(ite.Next()); } Console.WriteLine(); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } // TODO: Add your update logic here previousState = mouseState; mouseState = inputAdapter.GetMouseState(); mousePosition = new Vector2(mouseState.Position.X, mouseState.Position.Y); keyboardState = inputAdapter.GetKeyboardState(); switch (states) { case GameStates.MainWindow: while (mainWindowIterator.HasNext()) { mainWindowIterator.Next().Accept(updateVisitor); } break; case GameStates.LabelWindow: while (labelWindowIterator.HasNext()) { labelWindowIterator.Next().Accept(updateVisitor) ; } break; case GameStates.InputFieldWindow: while (inputfieldIterator.HasNext()) { inputfieldIterator.Next().Accept(updateVisitor); } break; } base.Update(gameTime); }
public String PrintMenu(IIterator iterator) { StringBuilder sb = new StringBuilder(); while (iterator.HasNext()) { MenuItem menuItem = (MenuItem)iterator.Next(); sb.Append(menuItem.Name + ", "); sb.Append(menuItem.Price + " -- "); sb.Append(menuItem.Description + "\n"); } return sb.ToString(); }
private static Actor[] FinishToArray(Actor[] r, IIterator it) { int i = r.Length; while (it.HasNext()) { int cap = r.Length; if (i == cap) { int newCap = ((cap / 2) + 1) * 3; if (newCap <= cap) { if (cap == int.MaxValue) newCap = int.MaxValue; } r = (Actor[])CollectionUtils.CopyOf(r, newCap); } r[i++] = (Actor)it.Next(); } return (i == r.Length) ? r : (Actor[])CollectionUtils.CopyOf(r, i); }
/// <summary>Handles the iteration of the children or qualfier</summary> /// <param name="iterator">an iterator</param> /// <returns>Returns if there are more elements available.</returns> private bool IterateChildrenMethod(IIterator iterator) { if (_enclosing._skipSiblings) { // setSkipSiblings(false); _enclosing._skipSiblings = false; _subIterator = Enumerable.Empty<object>().Iterator(); } // create sub iterator for every child, // if its the first child visited or the former child is finished if ((!_subIterator.HasNext()) && iterator.HasNext()) { var child = (XmpNode)iterator.Next(); _index++; _subIterator = new NodeIterator(_enclosing, child, _path, _index); } if (_subIterator.HasNext()) { _returnProperty = (IXmpPropertyInfo)_subIterator.Next(); return true; } return false; }