public void CreateGroup(int idx) { this.idx = idx; header = Create <AlbumHeader>(); header.name = "header"; AddChild(header); header.transform.localPosition = new Vector3(0, -1, 0); header.transform.localScale = new Vector3(0.84f, 0.93f, 0.84f); Album album; for (int i = 0; i < 8; i++) { album = Create <Album>(); AddChild(album); album.name = "album" + i; album.idx = i; album.posIdx = i <= 3 ? i : 4; album.SetTexture("album_0" + (i % 4)); album.transform.parent = transform; album.transform.localPosition = new Vector3(0, -1f, DISTANCE_Z * ((i < 3) ? i : 2)); album.transform.localScale = new Vector3(0.84f, 0.93f, 0.84f); albums.Add(album); } iter = new Interator <Album>(albums); }
static void Main(string[] args) { Aggregate aggregate = new Aggregate(); aggregate.arrayList = new System.Collections.ArrayList(); aggregate.arrayList.Add(1); aggregate.arrayList.Add(10); Interator interator = aggregate.CreateInterator(); while (interator.HasNext()) { Console.WriteLine(interator.Next()); } }
public /*static*/ void Main(string[] agrs) { Console.WriteLine("---- Canais de Filmes ----"); var canaisFilmes = new CanaisDeFilme(); Interator iterator = canaisFilmes.CrieInterator(); for (; iterator.HasValue(); iterator.Next()) { Console.WriteLine(iterator.CurrentItem().Nome); } Console.WriteLine("---- Canais de Esporte ----"); var canaisEsportes = new CanaisDeEsporte(); Interator iteratorEsporte = canaisEsportes.CrieInterator(); for (; iteratorEsporte.HasValue(); iteratorEsporte.Next()) { Console.WriteLine(iteratorEsporte.CurrentItem().Nome); } Console.ReadKey(); }