Inheritance: TriggeringTrigger
        private ScenarioStep Clone(ScenarioStep step)
        {
            ScenarioStep newStep = null;

            if (step is Given)
            {
                newStep = new Given();
            }
            else if (step is When)
            {
                newStep = new When();
            }
            else if (step is Then)
            {
                newStep = new Then();
            }
            else if (step is And)
            {
                newStep = new And();
            }
            else if (step is But)
            {
                newStep = new But();
            }

            Debug.Assert(newStep != null);

            newStep.Text = step.Text;
            newStep.MultiLineTextArgument = step.MultiLineTextArgument;
            newStep.TableArg      = Clone(step.TableArg);
            newStep.ScenarioBlock = step.ScenarioBlock;
            newStep.StepKeyword   = step.StepKeyword;

            return(newStep);
        }
Example #2
0
 public override bool OnConversion(But but)
 {
     Debug.Log("bravo");
     sm.state_change_son(this, new WaitingState(sm,cam,game,8,but.Owner.opponent, true));
     //game.refs.managers.conversion.But();
     return true;
 }
Example #3
0
 public override bool OnConversion(But but)
 {
     Debug.Log("bravo");
     game.Ball.OnConversion(true);
     sm.state_change_son(this, new WaitingState(sm, cam, game, 8, but.Owner.opponent, true));
     game.refs.managers.conversion.But();
     return(true);
 }
Example #4
0
    public void OnConversion(But but)
    {
        var src = this.refs.CameraAudio["But"];

        src.volume = 1f;
        src.PlayOneShot(this.refs.sounds.ButSound);

        this.refs.stateMachine.event_Conversion(but);
    }
Example #5
0
 private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (GameStarted)
     {
         foreach (Button But in Buttons)
         {
             But.Dispose();
         }
     }
 }
Example #6
0
 public void event_Conversion(But but)
 {
     foreach (State tmp in list)
     {
         if (tmp.OnConversion(but))
         {
             return;
         }
     }
 }
Example #7
0
        private static ScenarioStep ConvertToCompatibleStep(SpecFlowStep step)
        {
            ScenarioStep result = null;

            if (step.StepKeyword == StepKeyword.Given)
            {
                result = new Given {
                    StepKeyword = step.StepKeyword
                }
            }
            ;
            else if (step.StepKeyword == StepKeyword.When)
            {
                result = new When {
                    StepKeyword = step.StepKeyword
                }
            }
            ;
            else if (step.StepKeyword == StepKeyword.Then)
            {
                result = new Then {
                    StepKeyword = step.StepKeyword
                }
            }
            ;
            else if (step.StepKeyword == StepKeyword.And)
            {
                result = new And {
                    StepKeyword = step.StepKeyword
                }
            }
            ;
            else if (step.StepKeyword == StepKeyword.But)
            {
                result = new But {
                    StepKeyword = step.StepKeyword
                }
            }
            ;

            if (result == null)
            {
                throw new NotSupportedException();
            }

            result.Keyword               = step.Keyword;
            result.Text                  = step.Text;
            result.ScenarioBlock         = step.ScenarioBlock;
            result.MultiLineTextArgument = step.Argument is global::Gherkin.Ast.DocString ? ((global::Gherkin.Ast.DocString)step.Argument).Content : null;
            result.TableArg              = step.Argument is global::Gherkin.Ast.DataTable ? ConvertToCompatibleTable(((global::Gherkin.Ast.DataTable)step.Argument).Rows) : null;
            result.FilePosition          = ConvertToCompatibleFilePosition(step.Location);

            return(result);
        }
Example #8
0
 void ClearField()
 {
     if (GameStarted)
     {
         GameStarted = false;
         foreach (Button But in Buttons)
         {
             But.Dispose();
         }
     }
 }
Example #9
0
    public void OnDropTransformed(But but)
    {
        Debug.Log("La");

        // On donne les points
        but.Owner.opponent.nbPoints += this.game.settings.Global.Game.points_drop;

        // A faire en caméra :
        this.StartPlacement();
        this.game.Ball.Owner = but.Owner[2];

        IncreaseSuper(game.settings.Global.Super.dropWinSuperPoints, but.Owner.opponent);

        //this.game.TimedDisableIA(3);
    }
    public void OnDropTransformed(But but)
    {
        Debug.Log("La");

        // On donne les points
        but.Owner.opponent.nbPoints += this.game.settings.Global.Game.points_drop;

        // A faire en caméra :
        this.StartPlacement();
        this.game.Ball.Owner = but.Owner[2];

        IncreaseSuper(game.settings.Global.Super.dropWinSuperPoints, but.Owner.opponent);

        //this.game.TimedDisableIA(3);
    }
Example #11
0
    public override bool OnConversion(But but)
    {
        Debug.Log("Conversion");

        //Camera Time
        cam.transalateToWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f,2f,
            (/* OnFinish */) => {
                //please, kill after usage x)
                CameraFade.wannaDie();
            }, (/* OnFade */) => {
                cam.setTarget(game.Ball.Team[2].transform);
                game.Referee.OnDropTransformed(but);
            }
        );

        return true;
    }
Example #12
0
        private ScenarioStep Clone(ScenarioStep step)
        {
            ScenarioStep newStep = null;
            if (step is Given)
                newStep = new Given();
            else if (step is When)
                newStep = new When();
            else if (step is Then)
                newStep = new Then();
            else if (step is And)
                newStep = new And();
            else if (step is But)
                newStep = new But();

            Debug.Assert(newStep != null);

            newStep.Text = step.Text;
            newStep.MultiLineTextArgument = step.MultiLineTextArgument;
            newStep.TableArg = Clone(step.TableArg);
            return newStep;
        }
Example #13
0
    public override bool OnConversion(But but)
    {
        Debug.Log("Conversion");

        game.Ball.collider.enabled = false;
        game.Ball.OnConversion(true);

        //Camera Time
        cam.transalateToWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 1.5f,
                                 (/* OnFinish */) => {
            //please, kill after usage x)
            CameraFade.wannaDie();
        }, (/* OnFade */) => {
            game.Ball.OnConversion(false);
            cam.setTarget(game.Ball.Team[2].transform);
            game.Referee.OnDropTransformed(but);
            game.Ball.collider.enabled = true;
        }
                                 );

        return(true);
    }
Example #14
0
        public ScenarioStep CreateStep(string keyword, StepKeyword stepKeyword, string text, FilePosition position, ScenarioBlock scenarioBlock)
        {
            ScenarioStep step;

            switch (stepKeyword)
            {
            case StepKeyword.Given:
                step = new Given();
                break;

            case StepKeyword.When:
                step = new When();
                break;

            case StepKeyword.Then:
                step = new Then();
                break;

            case StepKeyword.And:
                step = new And();
                break;

            case StepKeyword.But:
                step = new But();
                break;

            default:
                throw new NotSupportedException();
            }

            step.Keyword       = keyword;
            step.Text          = text;
            step.FilePosition  = position;
            step.ScenarioBlock = scenarioBlock;
            step.StepKeyword   = stepKeyword;
            return(step);
        }
Example #15
0
 public void OnConversion(But but)
 {
     this.refs.stateMachine.event_Conversion(but);
 }
Example #16
0
    public void OnConversion(But but)
    {
        var src = this.refs.CameraAudio["But"];
        src.volume = 1f;
        src.PlayOneShot(this.refs.sounds.ButSound);

        this.refs.stateMachine.event_Conversion(but);
    }
Example #17
0
 public virtual bool OnConversion(But b)
 {
     return(false);
 }
Example #18
0
            public ChooseForm(string _Name, string[] _Buttons, string _Text = null)
            {
                Meth.HandleTheme(this);

                Finish    += new Action <int>(ChooseFinishEventHandler);
                FinishStr += new Action <string>(ChooseFinishStrEventHandler);

                this.Text = _Name;
                this.Size = new Size(Meth._S(250), Meth._S(200));
                this.Icon = new Icon(Settings.IconPath);

                FlowLayoutPanel p = new FlowLayoutPanel();

                p.Dock     = DockStyle.Fill;
                p.AutoSize = true;

                if (_Text != null)
                {
                    p.Controls.Add(new Elem.Text(_Text));
                }

                int   i     = 0;
                int   rtype = 0;
                Input inp   = new Input("__inp", "ANY", "", "", false, false);

                foreach (string Button in _Buttons)
                {
                    if (Button.StartsWith("IS-INPUT"))
                    {
                        if (Button.Contains("-BIG"))
                        {
                            inp.MakeBig();
                        }
                        if (Button.Contains("::"))
                        {
                            inp.SetType(Button.Substring(Button.IndexOf("::") + 2));
                        }
                        rtype = 1;
                        p.Controls.Add(inp);
                        p.Controls.Add(new Elem.NewLine());
                    }
                    else
                    {
                        bool   ret = false;
                        string bt;
                        if (Button.StartsWith("::"))
                        {
                            ret = true;
                            bt  = Button.Substring(2);
                        }
                        else
                        {
                            bt = Button;
                        }
                        But n  = new But(bt);
                        int ix = i;
                        n.Click += (s, e) => {
                            if (rtype == 1)
                            {
                                if (ret)
                                {
                                    FinishStr(inp.Text);
                                }
                                else
                                {
                                    FinishStr("");
                                }
                            }
                            else
                            {
                                Finish(ix);
                            }
                            this.Close();
                            this.Dispose();
                        };
                        p.Controls.Add(n);
                    }
                    i++;
                }

                this.Controls.Add(p);
                this.CenterToScreen();
            }
Example #19
0
 public void event_Conversion(But but)
 {
     foreach (State tmp in list)
     {
         if (tmp.OnConversion(but))
             return;
     }
 }
Example #20
0
 public virtual bool OnConversion(But b)
 {
     return (false);
 }