예제 #1
0
파일: NPC.cs 프로젝트: ebakkedahl/WCell
        internal protected NPC()
        {
            m_threatCollection = new ThreatCollection();

            // auras
            m_auras = new NPCAuraCollection(this);

            m_spells = NPCSpellCollection.Obtain(this);
        }
예제 #2
0
		public void TestThreatCollection()
		{
			var collection = new ThreatCollection();

			var npc1 = CreateDummy(1);
			var npc2 = CreateDummy(2);
			var npc3 = CreateDummy(3);

			collection.AddNewIfNotExisted(npc1);

			Assert.AreEqual(npc1, collection.CurrentAggressor);

			collection.AddNewIfNotExisted(npc2);

			Assert.AreEqual(npc1, collection.CurrentAggressor);

			collection[npc2] = 10000;

			Assert.AreEqual(npc2, collection.CurrentAggressor);

			collection[npc3] = 1000000;

			Assert.AreEqual(npc3, collection.CurrentAggressor);

			collection[npc3] = 1;

			Assert.AreEqual(npc2, collection.CurrentAggressor);
			Assert.AreEqual(3, collection.Size);

			collection.Remove(npc2);
			Assert.AreEqual(npc3, collection.CurrentAggressor);

			collection.Remove(npc3);
			Assert.AreEqual(npc1, collection.CurrentAggressor);

			collection.Remove(npc1);
			Assert.AreEqual(null, collection.CurrentAggressor);

		}
예제 #3
0
파일: NPC.cs 프로젝트: enjoii/WCell
		internal protected NPC()
		{
			m_threatCollection = new ThreatCollection();
		}