Beispiel #1
0
 private void SetDefaultStage(StageID DefaultID)
 {
     if (Stages_.ContainsKey(DefaultID))
     {
         DefaultStage_ = Stages_[DefaultID];
     }
 }
Beispiel #2
0
        public IStage CreateS3ActionInStage(IStage stage, string actionName, IBucket sourceCodeBucket, string bucketKey, Artifact_ outputArtifact, IRole role = null, S3Trigger s3Trigger = S3Trigger.POLL, double?runOrder = null)  //NOSONAR number of params
        {
            var action = HandlerResources.AwsCdkPipelineHandler.CreateS3Action(actionName, sourceCodeBucket, bucketKey, outputArtifact, role, s3Trigger, runOrder);

            stage.AddAction(action);
            return(stage);
        }
Beispiel #3
0
        public static IStage <T0, T1> SelectOrdered <T0, T, T1>(this IStage <T0, T> stage1, Func <T, T1> f, int count,
                                                                Action <Exception> errorCallback = null)
        {
            if (count < 2)
            {
                throw new ArgumentException("Count must be 2 or more", nameof(count));
            }

            OrderedRoundRobinFanOut <T> stages = new OrderedRoundRobinFanOut <T>();

            stages.Add(stage1);
            stages.SetUpSubscribe(stage1);
            IChannel <T1>    output = new Channel <T1>();
            OrderedJoin <T1> stub   = new OrderedJoin <T1>(output);

            stages.Add(stub);
            for (int i = 0; i < count; i++)
            {
                Stage <Ordered <T>, Ordered <T1> > stage = new Stage <Ordered <T>, Ordered <T1> >(x =>
                {
                    long index = x.Index;
                    T1 result  = f(x.Item);
                    return(new Ordered <T1>(index, result));
                }, errorCallback);
                stages.AddStage(stage);
                stub.Subscribe(stage);
            }

            return(new CompositeStage <T0, T1>(stage1, output, stages));
        }
 public StageUpdatedEventArgs(
     CachedStage oldStage,
     IStage newStage)
 {
     OldStage = oldStage;
     NewStage = newStage;
 }
Beispiel #5
0
 public MainWindow()
 {
     Instance = this;
     InitializeComponent();
     DataContext = this;
     S1          = s1;
 }
Beispiel #6
0
 public virtual void SetStatuses(IStage <TMeetType> stage)
 {
     foreach (var game in stage.Tours.SelectMany(tour => tour.Games))
     {
         game.Result.Winner.AddStatus(stage, new PairWinner());
     }
 }
Beispiel #7
0
        public override void update(GameTime gameTime, IStage stage)
        {
            if (Health <= 0)
            {
                IsDead    = true;
                IsVisible = false;
                //Drop Item
                setDrop();
                return;
            }

            base.update(gameTime, stage);

            //Calc Rotation
            Vector2 lookVek = stage.Character.Center - this.Center;

            Rotation = (float)Math.Atan2(lookVek.X, -lookVek.Y);

            //Movement
            lookVek.Normalize();
            velocity = lookVek * Speed;

            //Checks for Collision
            FutureRec = new Rectangle((int)(Position.X + velocity.X), (int)(Position.Y + velocity.Y), Rec.Width, Rec.Height);
            if (isColliding(FutureRec, Rotation, stage.Character))
            {
                Velocity = Vector2.Zero;
                stage.Character.damage(this);
            }
            Position += velocity;
        }
Beispiel #8
0
        public static string AskedQuestionSsml(this IStage stage, bool wrapInSpeakTags = true)
        {
            var sb = new StringBuilder();

            if (wrapInSpeakTags)
            {
                sb.Append("<speak>");
            }
            sb.Append("<p>");
            sb.Append(stage.Question);
            sb.Append("</p>");
            for (var i = 0; i < stage.Answers.Length; i++)
            {
                sb.Append(Alphabet[i]);
                sb.Append("<break time=\"800ms\"/>");
                sb.AppendLine(stage.Answers[i]);
                sb.Append("<break time=\"800ms\"/>");
            }

            if (wrapInSpeakTags)
            {
                sb.Append("</speak>");
            }

            return(sb.ToString());
        }
Beispiel #9
0
 public FestivalController(IStage stage, IInstrumentFactory instrumentFactory, IPerformerFactory performerFactory, ISongFactory songFactory)
 {
     this.stage             = stage;
     this.instrumentFactory = instrumentFactory;
     this.performerFactory  = performerFactory;
     this.songFactory       = songFactory;
 }
Beispiel #10
0
        private void UnPackSceneEntities(IStage stage, IEnumerable <IArchiveEntry <ZipArchiveEntry> > sceneEntityArchiveEntries, IActionResult actionResult)
        {
            foreach (var sceneEntityArchiveEntry in sceneEntityArchiveEntries)
            {
                var sceneEntityActionResult = new ActionResult <ISceneEntity>();
                var entity = UnPackEntity(sceneEntityArchiveEntry, sceneEntityActionResult);

                ValidateEntity <ISceneEntity>(entity, sceneEntityActionResult);

                if (sceneEntityActionResult.Success)
                {
                    var sceneEntity = (ISceneEntity)entity;

                    if (sceneEntityArchiveEntry.Geometry != null)
                    {
                        UnPackGeometry(sceneEntityArchiveEntry.Geometry, sceneEntity, sceneEntityActionResult);
                    }

                    if (sceneEntityActionResult.Success)
                    {
                        stage.Add(sceneEntity);
                    }
                }
                actionResult.CombineWith(sceneEntityActionResult);
            }
        }
Beispiel #11
0
        private void buildPlayers(IStage stage)
        {
            PictureBox newPlayer;
            int        i = 1;

            List <IPlayer> players = stage.GetPlayers();
            // make the current client the first on the game, it will be on top of the others
            int index = players.FindIndex(s => s.Username == hub.CurrentSession.Username);
            var item  = players[index];

            players[index]             = players[players.Count - 1];
            players[players.Count - 1] = item;

            foreach (IPlayer player in players)
            {
                if (player.Username == hub.CurrentSession.Username)
                {
                    hub.CurrentSession.PlayerId = player.ID;
                }
                newPlayer       = createControl("pacman" + i++, player.Position, Player.WIDTH, Player.HEIGHT);
                newPlayer.Image = global::pacman.Properties.Resources.Left;
                stageObjects.Add(player.ID, newPlayer);
                stageObjectsType.Add(player.ID, "player");
                Invoke(new System.Action(() =>
                {
                    panelGame.Controls.Add(newPlayer);
                    panelGame.Controls.SetChildIndex(newPlayer, 0);
                }));
            }
        }
Beispiel #12
0
        private void buildMonsters(IStage stage)
        {
            PictureBox newMonster;
            int        i = 1;

            foreach (IMonster monster in stage.GetMonsters())
            {
                newMonster = createControl("monster" + i++, monster.Position, MonsterAware.WIDTH, MonsterAware.HEIGHT);
                if (i % 3 == 0)
                {
                    newMonster.Image = global::pacman.Properties.Resources.pink_guy;
                }
                else if (i % 3 == 1)
                {
                    newMonster.Image = global::pacman.Properties.Resources.red_guy;
                }
                else if (i % 3 == 2)
                {
                    newMonster.Image = global::pacman.Properties.Resources.yellow_guy;
                }
                stageObjects.Add(monster.ID, newMonster);
                stageObjectsType.Add(monster.ID, "monster");
                Invoke(new System.Action(() => panelGame.Controls.Add(newMonster)));
            }
        }
Beispiel #13
0
 public Round(IPlayer player, TimeSpan timePerPlayer, IStage stage)
 {
     this.currentStage  = stage;
     this.CurrentPlayer = player;
     player.PlayerParticipateInStage(stage);
     this.RoundTimer = new RoundTimer(timePerPlayer);
 }
        public void CheckPerformSetsReturnMessageNotSongs()
        {
            Type   setControllerType = GetType("SetController");
            var    stageType         = GetType("Stage");
            IStage stage             = (IStage)Activator.CreateInstance(stageType);

            Type typeSetLong    = GetType("Long");
            var  stageInstance1 = (ISet)Activator.CreateInstance(typeSetLong, new object[] { "stage" });

            stage.AddSet(stageInstance1);
            var stageInstance2 = (ISet)Activator.CreateInstance(typeSetLong, new object[] { "stage2" });

            stage.AddSet(stageInstance2);
            Type typeSetShort   = GetType("Short");
            var  stageInstance3 = (ISet)Activator.CreateInstance(typeSetShort, new object[] { "stage3" });

            stage.AddSet(stageInstance3);

            var setControllerInstane = Activator.CreateInstance(setControllerType, new object[] { stage });

            MethodInfo PerformSetMethod = setControllerType.GetMethod("PerformSets");
            string     actualMessage    = (string)PerformSetMethod.Invoke(setControllerInstane, new object[0]);
            string     expectedMessage  = "1. stage:\r\n-- Did not perform\r\n2. stage2:\r\n-- Did not perform\r\n3. stage3:\r\n-- Did not perform";

            Assert.AreEqual(expectedMessage, actualMessage);
        }
Beispiel #15
0
        public void OnMoveUp(int index)
        {
            IStage stage = Stages[index - 1];

            Stages[index - 1] = Stages[index];
            Stages[index]     = stage;
        }
Beispiel #16
0
        protected override StageDocument CreateStageDocument(IStage stage)
        {
            var stageDocument = base.CreateStageDocument(stage);

            stageDocument.PolicyFileStage = stage.StagePolicy;
            return(stageDocument);
        }
Beispiel #17
0
        public void OnMoveDown(int index)
        {
            IStage stage = Stages[index + 1];

            Stages[index + 1] = Stages[index];
            Stages[index]     = stage;
        }
        public StreamingChunkGeneratorScript(IStage <ChunkKey, Entity> stage, StreamingStageMeshFactory meshFactory)
        {
            Contracts.Requires.That(stage != null);
            Contracts.Requires.That(meshFactory != null);

            this.meshFactory = meshFactory;

            stage.Activated.Subscribe(async pair =>
            {
                pair.Value.Transform.Position = pair.Key.Index.ToXenkoVector() * this.meshFactory.ChunkLength;
                this.Entity.AddChild(pair.Value);

                // Do not use DontMarshallContext here. Must stay on UI thread.
                var model = await this.generator?.GenerateModelAsync(pair.Key);
                if (model != null)
                {
                    pair.Value.Add(new ModelComponent(model));
                }
            });

            stage.Deactivated.Subscribe(pair =>
            {
                this.Entity.RemoveChild(pair.Value);
                pair.Value.Get <ModelComponent>()?.Model.Dispose();
                pair.Value.Dispose();
            });
        }
 public void SetUp()
 {
     this.stage         = new Stage();
     this.setController = new SetController(stage);
     this.set           = new Short("Atanas");
     this.stage.AddSet(set);
 }
 public FestivalController(IStage stage)
 {
     this.stage             = stage;
     this.performerFactory  = new PerformerFactory();
     this.instrumentFactory = new InstrumentFactory();
     this.setFactory        = new SetFactory();
 }
 public void WithOneBoundedSetup <T>(IStage <T, T> op,
                                     Action
                                     <Func <ISet <OneBoundedSetup.ITestEvent> >, OneBoundedSetup.UpstreamOneBoundedProbe <T>,
                                      OneBoundedSetup.DownstreamOneBoundedPortProbe <T> > spec)
 {
     WithOneBoundedSetup <T>(ToGraphStage(op), spec);
 }
Beispiel #22
0
        public override void update(GameTime gameTime, IStage stage)
        {
            if (Enabled && disTraveled < Range)
            {
                Position    += velocity;
                disTraveled += velocity.Length();

                foreach (RotatingSprite obj in stage.Everything)
                {
                    if (isColliding(obj) && !objCollided.Contains(obj))
                    {
                        objCollided.Add(obj);
                        hitObject(obj);
                        Pierce--;
                        Damage = Damage + inAccGen.Next(-Damage / 5, 1);
                        if (Pierce <= 0)
                        {
                            Enabled = false;
                        }
                        break;
                    }
                }
            }
            else
            {
                Enabled = IsVisible = false;
            }
        }
Beispiel #23
0
        public static Task DeleteAsync(this IStage instance,
                                       IRestRequestOptions options = null, CancellationToken cancellationToken = default)
        {
            var client = instance.GetRestClient();

            return(client.DeleteStageAsync(instance.ChannelId, options, cancellationToken));
        }
Beispiel #24
0
        public IStage CreateCloudFormationCreateUpdateStackActionInStage(IStage stage, string actionName, Artifact_ inputArtifact, string templatePath, string stackName, IRole deploymentRole, IRole role, CfnCapabilities[] cfnCapabilities) //NOSONAR number of params
        {
            var action = HandlerResources.AwsCdkPipelineHandler.CreateCloudFormationCreateUpdateStackAction(actionName, inputArtifact, templatePath, stackName, deploymentRole, role, cfnCapabilities);

            stage.AddAction(action);
            return(stage);
        }
Beispiel #25
0
    public void Register(int type, IStage st)
    {
        if (st == null || type <= 0) return;

        UnRegister(type);
        mStateMap.Add(type, st);
    }
Beispiel #26
0
        public IStage CreateEcrActionInStage(IStage stage, string actionName, string imageTag, Artifact_ outputArtifact, IRepository repositoryInstance, IRole role = null, string variableNamespace = null, double?runOrder = null)  //NOSONAR number of params
        {
            var action = HandlerResources.AwsCdkPipelineHandler.CreateEcrAction(actionName, imageTag, outputArtifact, repositoryInstance, role, variableNamespace, runOrder);

            stage.AddAction(action);
            return(stage);
        }
Beispiel #27
0
        UAsyncOperation LoadStage(IStage _stage, EStageStatus _next, Action <UStage> _completed, Action <IStage> _opationAtResting, Action <IStage> _optionAtLoading)
        {
            if (_stage.State == EStageStatus.Working)
            {
                return(_stage.Progress);
            }

            if (_stage.State == EStageStatus.Resting)
            {
                _opationAtResting?.Invoke(_stage);
                _completed?.Invoke(_stage as UStage);
                return(_stage.Progress);
            }
            else if (_stage.State == EStageStatus.Loading)
            {
                _optionAtLoading?.Invoke(_stage);
                //_stage.NextState = EStageStatus.Resting;
                (_stage.Progress as UStageRequest).Completed += _completed;
                return(_stage.Progress);
            }

            _stage.State     = EStageStatus.Loading;
            _stage.NextState = _next;
            _stage.Progress  = new UStageRequest(_stage, OnStageLoaded, _completed);
            return(_stage.Progress);
        }
 public FestivalController(IStage stage, ISetFactory setFactory,
                           IInstrumentFactory instrumentFactory)
 {
     this.stage             = stage;
     this.setFactory        = setFactory;
     this.instrumentFactory = instrumentFactory;
 }
Beispiel #29
0
        public IStage CreateEcsDeployActionInStage(IStage stage, string actionName, IBaseService service, uint deploymentTimeout, Artifact_ inputArtifact, IRole role = null, string variableNamespace = null, double?runOrder = null)  //NOSONAR number of params
        {
            var action = HandlerResources.AwsCdkPipelineHandler.CreateEcsDeployAction(actionName, service, deploymentTimeout, inputArtifact, role, variableNamespace, runOrder);

            stage.AddAction(action);
            return(stage);
        }
        public virtual void SetUp()
        {
            _stageFolderPath = Helper.GetUniqueName();
            Helper.MockFileSystemEnvironmentDocumentsFolder(_stageFolderPath);

            _dataAdapter = new StageFileSystemDataAdapter();
            _stage = new Stage { Name = Helper.GetUniqueName() };
        }
Beispiel #31
0
 public void Setup()
 {
     this.stage         = new Stage();
     this.setController = new SetController(stage);
     this.performer     = new Performer("Gosho", 55);
     this.instrument    = new Guitar();
     this.set           = new Short("Mile Kitic");
 }
 public static int GetCleared(IStage stage, int defaultClearLevel)
 {
     if (isCreativeMode)
     {
         return(3);
     }
     return(PlayerPrefs.GetInt($"stage.cleared.{stage.SceneName}", defaultClearLevel));
 }
Beispiel #33
0
 public void Termination()
 {
     _StandBys.DequeueAll();
     if(Current != null)
     {
         Current.Leave();
         Current = null;
     }
 }
Beispiel #34
0
    public void SetActiveState(int type, Utility.VoidDelegate clearHandle = null)
    {
        if (!mStateMap.ContainsKey(type)) return;

        if (mActiveState != null) mActiveState.OnExit();

        if (clearHandle != null) clearHandle();

        mActiveState = mStateMap[type];
        if (mActiveState != null) mActiveState.OnEnter();
        ActiveStateType = type;
    }
 public void Init()
 {
     ClearSelectedSceneElementsResult();
     _sceneEngineMock = new Mock<ISceneEngine>();
     _stage = new Stage();
     _sceneContent = new SceneContent(_sceneEngineMock.Object);
     _sceneContent.SelectedSceneElementsChanged += (sender, entities) =>
     {
         _receivedSelectedSceneElements = entities;
         _selectedSceneEntitiesEventFired = true;
     };
 }
Beispiel #36
0
        public override void onInit()
        {
            base.onInit();

            // Get bomber resources
            sprMoveLeft = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveLeft);
            sprMoveRight = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveRight);
            sprMoveUp = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveUp);
            sprMoveDown = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberMoveDown);
            sprWrapBomb = (Sprite)resourceManagement.GetResource<ISprite>(Shared.Resources.BomberWrapBomb);

            // Begin with move down
            sprCurrent = sprMoveDown;

            // Begin with idle stage
            stgBomberStage = IdleStage.getInstance();
            stgBomberStage.ApplyStageEffect(this);

            velocity = new Vector2(5f, 5f);

            Range = 2;
            Shared.Global.Counter_BombCanLocated = 1;
        }
Beispiel #37
0
 public void onStageChange(IStage stage)
 {
     if (stgBomberStage is WrapBombStage)
     {
         this.VelocityX *= (1f / Shared.Constants.BOMBER_VELOCITY_REDUCING);
         this.VelocityY *= (1f / Shared.Constants.BOMBER_VELOCITY_REDUCING);
     }
     stgBomberStage = stage;
     stgBomberStage.ApplyStageEffect(this);
 }
Beispiel #38
0
        public void StartGame(IStage stage)
        {
            this.CurrentCount = 0;
            this.enemies.Clear();

            if (this.StartedGame != null)
                this.StartedGame(this, EventArgs.Empty);

            const double interval = 0.1;
            const double totalCount = 20 / interval;
            var timer = new DispatcherTimer(DispatcherPriority.Normal, App.Current.Dispatcher);
            timer.Interval = TimeSpan.FromSeconds(interval);

            EventHandler gameOverHandler = null;
            gameOverHandler = (_, __) =>
            {
                timer.Stop();
                foreach (var e in this.enemies) e.Stop();
                this.Castle.GameOver -= gameOverHandler;
                MessageBox.Show("城が白旗上げた。", "ゲームオーバー");
                if (this.EndedGame != null)
                    this.EndedGame(this, EventArgs.Empty);
                this.Initialize();
            };
            this.Castle.GameOver += gameOverHandler;

            timer.Tick += (_, __) =>
            {
                if (this.CurrentCount++ >= totalCount)
                {
                    timer.Stop();
                    this.Castle.GameOver -= gameOverHandler;
                    this.Cleared = Math.Max(this.Cleared, stage.Number);
                    this.Money += stage.Reward;
                    if (this.EndedGame != null)
                        this.EndedGame(this, EventArgs.Empty);
                    return;
                }

                if (this.CurrentCount < totalCount * 0.85 && stage.NewEnemy())
                {
                    var e = new Bomb(this);
                    this.enemies.Add(e);
                    if (this.CreatedEnemy != null)
                        this.CreatedEnemy(this, GenericEventArgs.Create<Enemy>(e));
                }
            };
            timer.Start();
        }
Beispiel #39
0
 /// <summary>
 /// Set the stage to currently be in focus.
 /// </summary>
 /// <param name="Stage">The stage to focus</param>
 public void SetStage(IStage Stage)
 {
 }
 /// <summary>
 /// Save the stage with specified name.
 /// </summary>
 /// <param name="stage">The stage to be saved.</param>
 /// <returns>Result of the operation</returns>
 public IActionResult Save(IStage stage)
 {
     return _dataAdapter.Save(stage);
 }
Beispiel #41
0
        private void _SetCurrentStage()
        {
            IStage stage;
            if(_StandBys.TryDequeue(out stage))
            {
                if(Current != null)
                {
                    Current.Leave();
                }

                stage.Enter();
                Current = stage;
            }
        }
Beispiel #42
0
 public void Push(IStage new_stage)
 {
     _StandBys.Enqueue(new_stage);
 }
 /// <summary>
 /// Save the stage with specified name.
 /// </summary>
 /// <param name="stage">The stage to be saved.</param>
 /// <returns></returns>
 public IActionResult Save(IStage stage)
 {
     return _dataManager.Save(stage);
 }
		public EnqueueController(IStage stage)
		{
			_stage = stage;
		}
Beispiel #45
0
 public void Clear()
 {
     mStateMap.Clear();
     mActiveState = null;
 }
 private void _SetStatus(IStage status)
 {
     _Status.Push(status);
 }
Beispiel #47
0
		protected void TrackStageInstance(IStage stage)
		{
			if ((object)stage == null)
				throw new ArgumentNullException("stage");

			this.Stages.Add(stage);
		}