public string GetDescription() { var colorDescription = ButtonColorTranslator.GetDescriptionFor(colorAdj); var timeDescription = PressedTimeTranslator.GetDescriptionFor(timeAdj); return(colorDescription + " buttons should pressed only in " + timeDescription + "!"); }
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"); } } }