예제 #1
0
        static void Main(string[] args)
        {
            // Array of Structures
            var creatures = new Creature[100];

            foreach (Creature creature in creatures)
            {
                creature.X++;
            }

            // Structure of Arrays
            var creatures2 = new Creatures(100);

            foreach (Creatures.CreatureProxy creature in creatures2)
            {
                creature.X++;
            }
        }
예제 #2
0
 public CreatureProxy(Creatures creatures, int index)
 {
     _creatures = creatures;
     _index     = index;
 }