コード例 #1
0
 /**
  * @test
  */
 public function I_can_create_it()
 {
     $zeroLevel = $this->createZeroLevel();
     $firstLevel = $this->createFirstLevel('fighter');
     $withFirstLevelOnly = new ProfessionLevels($zeroLevel, $firstLevel);
     self::assertNotNull($withFirstLevelOnly);
     $anotherInstance = ProfessionLevels::createIt($zeroLevel, $firstLevel);
     self::assertEquals($withFirstLevelOnly, $anotherInstance);
     $yetAnotherInstance = ProfessionLevels::createIt($zeroLevel, $firstLevel);
     self::assertNotSame($anotherInstance, $yetAnotherInstance);
     $withExplicitlyEmptyNextLevels = ProfessionLevels::createIt($zeroLevel, $firstLevel, []);
     self::assertEquals($withFirstLevelOnly, $withExplicitlyEmptyNextLevels);
     $withNextLevels = ProfessionLevels::createIt($zeroLevel, $firstLevel, $nextLevels = [ProfessionNextLevel::createNextLevel(Fighter::getIt(), LevelRank::getIt(2), Strength::getIt(1), Agility::getIt(0), Knack::getIt(0), Will::getIt(0), Intelligence::getIt(1), Charisma::getIt(0))]);
     self::assertNotEquals($withFirstLevelOnly, $withNextLevels);
 }
 public static function createEntities()
 {
     $factory = new ExceptionalityPropertiesFactory();
     return [new Exceptionality(PlayerDecision::getIt(), $fate = FateOfGoodRear::getIt(), $factory->createChosenProperties($fate, ProfessionFirstLevel::createFirstLevel(Fighter::getIt()), 0, 1, 1, 0, 0, 1)), $factory->createChosenProperties(FateOfCombination::getIt(), ProfessionFirstLevel::createFirstLevel(Wizard::getIt()), 1, 1, 1, 1, 1, 1), $factory->createFortuneProperties(FateOfExceptionalProperties::getIt(), ProfessionFirstLevel::createFirstLevel(Thief::getIt()), 1, 3, 6, 5, 4, 2, new BasePropertiesFactory())];
 }
 /**
  * @return array
  */
 public static function createEntities()
 {
     $professionLevels = new ProfessionLevels(ProfessionZeroLevel::createZeroLevel(Commoner::getIt()), ProfessionFirstLevel::createFirstLevel($profession = Theurgist::getIt()));
     $professionLevels->addLevel(ProfessionNextLevel::createNextLevel($profession, LevelRank::getIt(2), Strength::getIt(1), Agility::getIt(0), Knack::getIt(0), Will::getIt(0), Intelligence::getIt(1), Charisma::getIt(0)));
     return [ProfessionZeroLevel::createZeroLevel(Commoner::getIt()), ProfessionFirstLevel::createFirstLevel(Fighter::getIt()), ProfessionNextLevel::createNextLevel(Wizard::getIt(), LevelRank::getIt(2), Strength::getIt(1), Agility::getIt(1), Knack::getIt(0), Will::getIt(0), Intelligence::getIt(0), Charisma::getIt(0)), $professionLevels];
 }
コード例 #4
0
 protected function createEntitiesToPersist()
 {
     return [new SomeEntityWithProfessions(Fighter::getIt(), null, null, null, null, null, Fighter::getIt()), new SomeEntityWithProfessions(null, Thief::getIt(), null, null, null, null, Thief::getIt()), new SomeEntityWithProfessions(null, null, Wizard::getIt(), null, null, null, Wizard::getIt()), new SomeEntityWithProfessions(null, null, null, Priest::getIt(), null, null, Priest::getIt()), new SomeEntityWithProfessions(null, null, null, null, Theurgist::getIt(), null, Theurgist::getIt()), new SomeEntityWithProfessions(null, null, null, null, null, Ranger::getIt(), Ranger::getIt())];
 }
コード例 #5
0
 private function createPersonEntity(Tables $tables, ExceptionalityPropertiesFactory $exceptionalityPropertiesFactory)
 {
     return new Person(CommonHuman::getIt(), Male::getIt(), Name::getIt('foo'), new Exceptionality(PlayerDecision::getIt(), $fate = FateOfGoodRear::getIt(), $exceptionalityPropertiesFactory->createChosenProperties($fate, $professionFirstLevel = ProfessionFirstLevel::createFirstLevel(Fighter::getIt()), 0, 1, 1, 0, 1, 0)), new Memories(), $professionLevels = new ProfessionLevels(ProfessionZeroLevel::createZeroLevel(Commoner::getIt()), $professionFirstLevel), $background = Background::createIt($fate, 4, 3, 5), Skills::createSkills($professionLevels, $background->getBackgroundSkillPoints(), new PhysicalSkills(ProfessionZeroLevel::createZeroLevel(Commoner::getIt())), new PsychicalSkills(ProfessionZeroLevel::createZeroLevel(Commoner::getIt())), new CombinedSkills(ProfessionZeroLevel::createZeroLevel(Commoner::getIt())), $tables), WeightInKg::getIt(123.45), HeightInCm::getIt(78.89), Age::getIt(56), $tables);
 }
 public static function createSkillsEntity(Tables $tables)
 {
     return Skills::createSkills(ProfessionLevels::createIt(ProfessionFirstLevel::createFirstLevel($profession = Fighter::getIt()), [ProfessionNextLevel::createNextLevel($profession, LevelRank::getIt(2), Strength::getIt(0), Agility::getIt(1), Knack::getIt(0), Will::getIt(0), Intelligence::getIt(1), Charisma::getIt(0))]), BackgroundSkillPoints::getIt(2, Heritage::getIt(7)), $tables, new PhysicalSkills(), new PsychicalSkills(), new CombinedSkills());
 }