Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var creatures = new Creature[100];
            //foreach (var c in creatures)
            //{
            //    c.X++; // not memory-efficient
            //}

            var creatures2 = new Creatures(100);

            foreach (var c in creatures2)
            {
                c.X++;
            }
        }
Exemplo n.º 2
0
 public CreatureProxy(Creatures creatures, int index)
 {
     this.creatures = creatures;
     this.index     = index;
 }