예제 #1
0
        public void GetThisPartyStarted(int numberofElves)
        {
            var firstElf = new Elf(1, 1, null, null);
            var elf      = firstElf;

            for (var i = 2; i < numberofElves + 1; i++)
            {
                var nextElf = new Elf(i, 1, null, elf);
                elf.Next = nextElf;
                elf      = nextElf;
            }

            elf.Next          = firstElf;
            firstElf.Previous = elf;
            Target            = firstElf.Next;
            CurrentPlayer     = firstElf;
        }
예제 #2
0
        public void GetThisPartyStarted(int numberofElves)
        {
            var firstElf    = new Elf(1, 1, null, null);
            var elf         = firstElf;
            var targetIndex = GetTargetId(numberofElves, firstElf.Id);

            for (var i = 2; i < numberofElves + 1; i++)
            {
                var nextElf = new Elf(i, 1, null, elf);
                elf.Next = nextElf;
                elf      = nextElf;

                if (targetIndex == i)
                {
                    Target = elf;
                }
            }

            Participants      = numberofElves;
            elf.Next          = firstElf;
            firstElf.Previous = elf;
            CurrentPlayer     = firstElf;
        }
예제 #3
0
 public void TakePresents(Elf target)
 {
     NumberOfPresents       += target.NumberOfPresents;
     target.NumberOfPresents = 0;
 }