public void Update() { foreach (Creature newParent in ParentList) { CreatureList.Add(new Creature(this, newParent)); } ParentList.Clear(); // 当たり判定用にどこにいるかを登録 foreach (Creature creature in CreatureList.Where(x => x.Existence == true)) { Land.AddCList(creature.Position, creature); } // Creatureの更新 bool isTimeToUpdate = (++timer % timerMax) == 0; if (isTimeToUpdate) { foreach (Creature creature in CreatureList.Where(x => x.Existence == true)) { creature.Update(); } } foreach (Creature creature in CreatureList.Where(x => x.Existence == true)) { creature.Move(); } hasTimerUpdated = false; // 消去フラグの立った生物は削除 CreatureList.RemoveAll(x => x.Existence == false); TimeCount++; }
internal void Render(bool reload) { if (!reload) { IsExpanded = !IsExpanded; IsExpanded = !IsExpanded; return; } IsExpanded = false; _Control.ResetGrid(true); Filter = string.Empty; ParentList.Clear(); foreach (var file in _Proxy.GetParentList()) { ParentList.Add(file); } using (FileList.DeferRefresh()) { _AddSortDescription(); IsExpanded = true; } CurrentParent = _DefaultFile; if (0 != ParentList.Count) { CurrentParent = ParentList.First(); _Control.ResetGrid(false); } CurrentParent.Load(); IsRendered = true; PopulateAvailableItems(); }
public void ClearSemantics() { var parent = new SimpleParent(); var child1 = new Lists.ListMonitors.NotifyChildBase <SimpleParent>(); var child2 = new Lists.ListMonitors.NotifyChildBase <SimpleParent>(); var list = new ParentList <Lists.ListMonitors.NotifyChildBase <SimpleParent>, SimpleParent>(parent); Assert.Null(child2.Parent); list.Add(child1); Assert.Equal(parent, child1.Parent); list.Add(child2); Assert.Equal(parent, child2.Parent); list.Clear(); Assert.Null(child1.Parent); Assert.Null(child2.Parent); }