Пример #1
0
    public string GetDescription()
    {
        var colorDescription = ButtonColorTranslator.GetDescriptionFor(colorAdj);
        var timeDescription  = PressedTimeTranslator.GetDescriptionFor(timeAdj);

        return(colorDescription + " buttons should pressed only in " + timeDescription + "!");
    }
Пример #2
0
    public void Test(GameObject obj, RuleVeredict veredict)
    {
        DateTime time = GameController.Instance.GetCurrentTime();

        ButtonColor color = obj.GetComponent <ButtonColor>();

        if (color && color.GetAdj() == colorAdj)
        {
            if (PressedTimeTranslator.TimeSatisfies(time, timeAdj))
            {
                veredict.AddScore(1);
            }
            else
            {
                veredict.AddScore(-1);
                veredict.AddFailureReason("Pressed button at wrong time of day");
            }
        }
    }