コード例 #1
0
        public void SetUp()
        {
            _targetingData    = GetTargetingData();
            _callbackTarget   = null;
            _callbackHappened = false;

            _renderer = Substitute.For <IUnifiedRenderer>();
            var rendererSystem = Substitute.For <IRendererSystem>();

            rendererSystem.Renderer.Returns(_renderer);

            var playerSystem = Substitute.For <IPlayerSystem>();

            _activityStack = new ActivityStack();
            _ioConfig      = new IOSystemConfiguration();
            _activityStack.Push(new GameplayActivity(new Rectangle(0, 0, 0, 0), new Padding(0), _ioConfig, playerSystem));
            _activitySystem  = Substitute.For <IActivitySystem>();
            _positionSystem  = Substitute.For <IPositionSystem>();
            _targetingSystem = Substitute.For <ITargetingSystem>();
            _systemContainer = Substitute.For <ISystemContainer>();
            _systemContainer.ActivitySystem.Returns(_activitySystem);
            _systemContainer.PositionSystem.Returns(_positionSystem);
            _systemContainer.RendererSystem.Returns(rendererSystem);
            _systemContainer.TargetingSystem.Returns(_targetingSystem);

            SetTargetableCells(new MapCoordinate("Map", 1, 0));

            _targetingActivity = new TargetingActivity(_activitySystem.DefaultPosition, _activitySystem.DefaultPadding, _targetingData, _callback, _systemContainer, new MapCoordinate("Map", 0, 0), _ioConfig);
            _activityStack.Push(_targetingActivity);
        }
コード例 #2
0
 private void InjectPlayerController([ApplicationScope] KeyboardInputSensor keyboardInputSensor,
                                     [ApplicationScope] MouseInputSensor mouseInputSensor,
                                     [ApplicationScope] ActivityStack activityStack,
                                     [ApplicationScope] AchivementController achivementController,
                                     [EntityScope] PlayerMover playerMover,
                                     [EntityScope] Health health,
                                     [EntityScope] Inventory inventory,
                                     [EntityScope] InteractableSensor interactableSensor,
                                     [EntityScope] ItemSensor itemSensor,
                                     [EntityScope] SoldierAnimatorUpdater soldierAnimatorUpdater,
                                     [GameObjectScope] NetworkIdentity networkIdentity,
                                     [EventChannelScope] DeathCircleHurtEventChannel deathCircleHurtEventChannel,
                                     [EventChannelScope] BoostHealEventChannel boostHealEventChannel,
                                     [EventChannelScope] PlayerDeathEventChannel playerDeathEventChannel,
                                     [EventChannelScope] SpawnItemDropEventChannel spawnItemDropEventChannel)
 {
     this.keyboardInputSensor = keyboardInputSensor;
     this.mouseInputSensor    = mouseInputSensor;
     this.activityStack       = activityStack;
     this.playerMover         = playerMover;
     this.health                      = health;
     this.inventory                   = inventory;
     this.interactableSensor          = interactableSensor;
     this.itemSensor                  = itemSensor;
     this.networkIdentity             = networkIdentity;
     this.deathCircleHurtEventChannel = deathCircleHurtEventChannel;
     this.boostHealEventChannel       = boostHealEventChannel;
     this.soldierAnimatorUpdater      = soldierAnimatorUpdater;
     this.playerDeathEventChannel     = playerDeathEventChannel;
     this.spawnItemDropEventChannel   = spawnItemDropEventChannel;
     this.achivementController        = achivementController;
 }
コード例 #3
0
        public void RemoveActivity(IActivity activity)
        {
            var list = ActivityStack.ToList();

            list.Remove(activity);
            list.Reverse();

            ActivityStack = new ActivityStack(list);
        }
コード例 #4
0
 void agentServer_Connected(object sender, EventArgs e)
 {
     isTerminating = false;
     ActivityStack.Clear();
     ActivityStack.Update();
     EXECUTION_INDEX = 0;
     recorder.Stop();
     recorder.SetNormalMode();
     tracker.Stop();
 }
コード例 #5
0
        public void Id_NotEmpty()
        {
            IDisposable disposable = null;

            try
            {
                // arrange
                Guid activityId = Guid.NewGuid();
                disposable = ActivityStack.Push(activityId);

                // act
                Guid result = ActivityStack.Id;

                // assert
                Assert.Equal(activityId, result);
            }
            finally
            {
                disposable?.Dispose();
            }
        }
コード例 #6
0
 private Activity(string name)
 {
     _name = name;
     _relatedActivityId = ActivityStack.Id;
     _popWhenDisposed   = ActivityStack.Push(_activityId);
 }
コード例 #7
0
 private void InjectLoadInitialActivity([ApplicationScope] ActivityStack activityStack)
 {
     this.activityStack = activityStack;
 }
コード例 #8
0
 private void InjectLoadingScreenController([EntityScope] Canvas loadingScreenCanvas,
                                            [ApplicationScope] ActivityStack activityStack)
 {
     this.loadingScreenCanvas = loadingScreenCanvas;
     this.activityStack       = activityStack;
 }
コード例 #9
0
 public bool HasActivity(IActivity activity)
 {
     return(ActivityStack.Contains(activity));
 }
コード例 #10
0
        public void OpenShop(ISystemContainer systemContainer, IEntity shop)
        {
            var shoppingActivity = new ShopActivity(DefaultPosition, DefaultPadding, systemContainer, shop);

            ActivityStack.Push(shoppingActivity);
        }
コード例 #11
0
 public void Initialise(Rectangle defaultPosition, Padding defaultPadding)
 {
     ActivityStack   = new ActivityStack();
     DefaultPosition = defaultPosition;
     DefaultPadding  = defaultPadding;
 }
コード例 #12
0
 private HotChocolateActivity(HotChocolateRequest request)
 {
     _relatedActivityId = ActivityStack.Id;
     _popWhenDispose    = ActivityStack.Push(Id);
     Request            = request;
 }
コード例 #13
0
 private void InjectChangePlayerScene([ApplicationScope] ActivityStack activityStack)
 {
     this.activityStack = activityStack;
 }
コード例 #14
0
 private void InjectCreateItemsSpawner([ApplicationScope] ActivityStack activityStack,
                                       [GameObjectScope] PlayerController playerController)
 {
     this.activityStack    = activityStack;
     this.playerController = playerController;
 }
コード例 #15
0
 private ClientRequestActivity()
 {
     _relatedActivityId = ActivityStack.Id;
     _popWhenDispose    = ActivityStack.Push(_activityId);
 }
コード例 #16
0
 private HotChocolateActivity()
 {
     _relatedActivityId = ActivityStack.Id;
     _popWhenDispose    = ActivityStack.Push(Id);
 }