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); }
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; }
public void RemoveActivity(IActivity activity) { var list = ActivityStack.ToList(); list.Remove(activity); list.Reverse(); ActivityStack = new ActivityStack(list); }
void agentServer_Connected(object sender, EventArgs e) { isTerminating = false; ActivityStack.Clear(); ActivityStack.Update(); EXECUTION_INDEX = 0; recorder.Stop(); recorder.SetNormalMode(); tracker.Stop(); }
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(); } }
private Activity(string name) { _name = name; _relatedActivityId = ActivityStack.Id; _popWhenDisposed = ActivityStack.Push(_activityId); }
private void InjectLoadInitialActivity([ApplicationScope] ActivityStack activityStack) { this.activityStack = activityStack; }
private void InjectLoadingScreenController([EntityScope] Canvas loadingScreenCanvas, [ApplicationScope] ActivityStack activityStack) { this.loadingScreenCanvas = loadingScreenCanvas; this.activityStack = activityStack; }
public bool HasActivity(IActivity activity) { return(ActivityStack.Contains(activity)); }
public void OpenShop(ISystemContainer systemContainer, IEntity shop) { var shoppingActivity = new ShopActivity(DefaultPosition, DefaultPadding, systemContainer, shop); ActivityStack.Push(shoppingActivity); }
public void Initialise(Rectangle defaultPosition, Padding defaultPadding) { ActivityStack = new ActivityStack(); DefaultPosition = defaultPosition; DefaultPadding = defaultPadding; }
private HotChocolateActivity(HotChocolateRequest request) { _relatedActivityId = ActivityStack.Id; _popWhenDispose = ActivityStack.Push(Id); Request = request; }
private void InjectChangePlayerScene([ApplicationScope] ActivityStack activityStack) { this.activityStack = activityStack; }
private void InjectCreateItemsSpawner([ApplicationScope] ActivityStack activityStack, [GameObjectScope] PlayerController playerController) { this.activityStack = activityStack; this.playerController = playerController; }
private ClientRequestActivity() { _relatedActivityId = ActivityStack.Id; _popWhenDispose = ActivityStack.Push(_activityId); }
private HotChocolateActivity() { _relatedActivityId = ActivityStack.Id; _popWhenDispose = ActivityStack.Push(Id); }