private void StartDeploymentProcess(Vector3 position, Vector3 direction, int unitsCount)
    {
        Process p = new TimeProcess("Arriving: " + _unitType, deploymentTime);

        p.onFinished += () => OnDeploymentProcessFinished(position, direction, unitsCount);
        Game.processesManager.StartProcess(p);
    }
    private void StartDeploymentProcess(Vector3 position)
    {
        Process p = new TimeProcess("Calling: " + _abilityType, delayTime);

        p.onFinished += () => OnDeploymentProcessFinished(position);
        Game.processesManager.StartProcess(p);
    }
    public Process CreateResearchProcess()
    {
        if (state != TechTreeNodeState.Available)
        {
            throw new Exception("Can not create research process, wrong node state: " + name + ", " + state);
        }

        Process p = new TimeProcess(name, researchTime);

        p.onStarted    += () => TryChangeState(TechTreeNodeState.Available, TechTreeNodeState.InProcess);
        p.onFinished   += () => TryChangeState(TechTreeNodeState.InProcess, TechTreeNodeState.Researched);
        p.onTerminated += () => TryChangeState(TechTreeNodeState.InProcess, TechTreeNodeState.Available);
        return(p);
    }
Beispiel #4
0
        public void ProcessTest()
        {
            for (int i = 1; i <= 22; i++)
            {
                string s1 = @".\tests\" + String.Format("{0:00}", i);
                string s2 = @".\tests\" + String.Format("{0:00}", i) + ".a";

                string t1 = System.IO.File.ReadAllText(s1);
                string t2 = System.IO.File.ReadAllText(s2);

                string Delimiter = "\r\n";
                var    t1SplitRN = t1.Split(new[] { Delimiter }, StringSplitOptions.None);


                var inputFirstLine = t1SplitRN[0].Split(' ');

                int bufferSize = Int32.Parse(inputFirstLine[0]);
                int packNumber = Int32.Parse(inputFirstLine[1]);

                List <Pack> inputList = new List <Pack>();

                for (int j = 1; j <= packNumber; j++)
                {
                    var  packInput = t1SplitRN[j].Split(' ');
                    Pack thepack   = new Pack(Int32.Parse(packInput[0]), Int32.Parse(packInput[1]), j - 1);
                    inputList.Add(thepack);
                }


                string expected = t2;
                using (var consoleOutput = new ConsoleOutput())
                {
                    TimeProcess.Process(bufferSize, inputList);
                    string error = "Case" + String.Format("{0:00}", i);
                    Assert.AreEqual(expected, consoleOutput.GetOuput(), error);
                }
            }
        }