예제 #1
0
 public function testNpcListSortedByDifficultyGetsEasyNpcLast()
 {
     $npcs_by_diff = NpcFactory::allSortedByDifficulty();
     $first_npc = reset($npcs_by_diff);
     $last_npc = array_pop($npcs_by_diff);
     $this->assertLessThan(10, $first_npc->difficulty());
     $this->assertEquals('Ryu', $last_npc->identity());
     // For now ryu will be the testable top npc.
     $this->assertGreaterThan(300, $last_npc->difficulty());
 }
예제 #2
0
 /**
  * Npcs that have essentially nothing interesting or useful defined about them yet.
  **/
 public static function allTrivialNpcs()
 {
     $npcs = NpcFactory::allSortedByDifficulty();
     $trivials = array_filter($npcs, function ($npc) {
         return (bool) ($npc->difficulty() < 1);
     });
     return $trivials;
 }