예제 #1
0
        public void SetUp()
        {
            this.logger = new ActionLog();
            GlobalConstants.ActionLog = this.logger;

            this.target = new CombatEngine(Mock.Of <IRollable>(
                                               roller => roller.RollSuccesses(
                                                   It.IsAny <int>(),
                                                   It.IsIn <int>(7)) == 1 &&
                                               roller.RollSuccesses(
                                                   It.IsAny <int>(),
                                                   It.IsNotIn(7)) == 2));
            this.statisticHandler    = new EntityStatisticHandler();
            this.skillHandler        = new EntitySkillHandler();
            this.derivedValueHandler = new DerivedValueHandler(this.statisticHandler, this.skillHandler);
            this.abilityHandler      = new AbilityHandler();

            this.materialHandler = new MaterialHandler();

            this.objectIconHandler = new ObjectIconHandler(new RNG());

            this.itemHandler = new LiveItemHandler(new RNG());

            GlobalConstants.GameManager = Mock.Of <IGameManager>(
                manager => manager.ItemHandler == this.itemHandler &&
                manager.ObjectIconHandler == this.objectIconHandler);

            this.needHandler = new NeedHandler();
        }
예제 #2
0
 public EatEnvironmentAction(ActorData actorData, float energyCost, IActionEffectFactory actionEffectFactory,
                             INeedHandler needHandler, ITextEffectPresenter textEffectPresenter)
     : base(actorData, energyCost, actionEffectFactory)
 {
     _needHandler         = needHandler;
     _textEffectPresenter = textEffectPresenter;
 }
예제 #3
0
        public void SetUp()
        {
            GlobalConstants.ActionLog = new ActionLog();
            this.ScriptingEngine      = new ScriptingEngine();

            IGameManager gameManager = Mock.Of <IGameManager>(
                manager => manager.RelationshipHandler == Mock.Of <IEntityRelationshipHandler>() &&
                manager.ObjectIconHandler == Mock.Of <IObjectIconHandler>(
                    handler => handler.GetManagedSprites(
                        It.IsAny <string>(),
                        It.IsAny <string>(),
                        It.IsAny <string>())
                    == new[]
            {
                new SpriteData
                {
                    Name  = "DEFAULT",
                    Parts = new List <SpritePart>
                    {
                        new SpritePart
                        {
                            m_Frames = 1
                        }
                    },
                    State = "DEFAULT"
                }
            }));

            GlobalConstants.GameManager = gameManager;

            this.target = new NeedHandler();
        }
예제 #4
0
 public EntityFactory(
     GUIDManager guidManager,
     INeedHandler needHandler,
     IObjectIconHandler objectIconHandler,
     ICultureHandler cultureHandler,
     IEntitySexualityHandler sexualityHandler,
     IEntityBioSexHandler sexHandler,
     IGenderHandler genderHandler,
     IEntityRomanceHandler romanceHandler,
     IJobHandler jobHandler,
     IPhysicsManager physicsManager,
     IEntitySkillHandler skillHandler,
     IDerivedValueHandler derivedValueHandler,
     RNG roller)
 {
     this.GuidManager         = guidManager;
     this.Roller              = roller;
     this.NeedHandler         = needHandler;
     this.ObjectIcons         = objectIconHandler;
     this.CultureHandler      = cultureHandler;
     this.SexualityHandler    = sexualityHandler;
     this.BioSexHandler       = sexHandler;
     this.JobHandler          = jobHandler;
     this.RomanceHandler      = romanceHandler;
     this.GenderHandler       = genderHandler;
     this.PhysicsManager      = physicsManager;
     this.SkillHandler        = skillHandler;
     this.DerivedValueHandler = derivedValueHandler;
 }
예제 #5
0
 public ActorController(IAiActionResolver aiActionResolver, IPlayerActionResolver playerActionResolver,
                        ITileVisibilityUpdater tileVisibilityUpdater, INeedHandler needHandler)
 {
     _aiActionResolver      = aiActionResolver;
     _playerActionResolver  = playerActionResolver;
     _tileVisibilityUpdater = tileVisibilityUpdater;
     _needHandler           = needHandler;
 }
예제 #6
0
 public EatAction(ActorData actorData, float energyCost, IActionEffectFactory actionEffectFactory, INeedHandler needHandler,
                  ITextEffectPresenter textEffectPresenter, IEntityRemover entityRemover, ItemData foodItemToEat)
     : base(actorData, energyCost, actionEffectFactory)
 {
     _needHandler         = needHandler;
     _textEffectPresenter = textEffectPresenter;
     _entityRemover       = entityRemover;
     _foodItemToEat       = foodItemToEat;
 }
예제 #7
0
 public ActionFactory(IGridInfoProvider gridInfoProvider, IActionEffectFactory actionEffectFactory,
                      ITextEffectPresenter textEffectPresenter, INeedHandler needHandler, IRandomNumberGenerator randomNumberGenerator,
                      IDeathHandler deathHandler, IEntityRemover entityRemover, IEntityDetector entityDetector, IGameContext gameContext,
                      IEntitySpawner entitySpawner, IUiConfig uiConfig)
 {
     _gridInfoProvider      = gridInfoProvider;
     _actionEffectFactory   = actionEffectFactory;
     _textEffectPresenter   = textEffectPresenter;
     _needHandler           = needHandler;
     _randomNumberGenerator = randomNumberGenerator;
     _deathHandler          = deathHandler;
     _entityRemover         = entityRemover;
     _entityDetector        = entityDetector;
     _gameContext           = gameContext;
     _entitySpawner         = entitySpawner;
     _uiConfig = uiConfig;
 }