예제 #1
0
 public Property checkifLevelFunctionWorks(int level, int nodeCapacityMultiplier, int numberOfMonsters)
 {
     if (level > 0 && nodeCapacityMultiplier > 0)
     {
         Dungeon dungeon = new Dungeon(level, nodeCapacityMultiplier, numberOfMonsters, new Player("test"));
         return((dungeon.Level(dungeon.exitNode) == level).ToProperty());
     }
     else
     {
         return(true.ToProperty());
     }
 }
예제 #2
0
 public Property checkifLevelFunctionWorks(uint level, uint nodeCapacityMultiplier)
 {
     if (level > 0 && nodeCapacityMultiplier > 0)
     {
         Dungeon dungeon = new Dungeon(level, nodeCapacityMultiplier);
         return((dungeon.Level(dungeon.exitNode) == level).ToProperty());
     }
     else
     {
         return(true.ToProperty());
     }
 }
예제 #3
0
파일: Pack.cs 프로젝트: svatwork/rpg-v1
        /* Move the pack to an adjacent node. */
        public void Move(Node u)
        {
            if (!location.neighbors.Contains(u))
            {
                throw new ArgumentException();
            }
            int capacity = (int)(dungeon.M * (dungeon.Level(u) + 1));

            // count monsters already in the node:
            foreach (Pack Q in location.packs)
            {
                capacity = capacity - Q.members.Count;
            }
            // capacity now expresses how much space the node has left
            if (members.Count > capacity)
            {
                Logger.log("Pack " + id + " is trying to move to a full node " + u.id + ", but this would cause the node to exceed its capacity. Rejected.");
                return;
            }
            location.packs.Remove(this);
            location = u;
            u.packs.Add(this);
            Logger.log("Pack " + id + " moves to an already full node " + u.id + ". Rejected.");
        }