示例#1
0
        //TODO: Should this be in XAML? Would that make it better?
        //TODO: Should I change the height, width and stroke to be relative to the screen size?
        //TODO: Where can I get REALLY complex shapes like animal vectors or custom pics? Where do I store them?

        public static FigureTemplate GenerateFigureTemplate(char displayChar)
        {
            Color c = Utils.GetRandomColor();

            string name = null;
            KeyValuePair <BabySmashShape, BrushControlFunc> nameFunc = hashTableOfFigureGenerators[Utils.RandomBetweenTwoNumbers(0, hashTableOfFigureGenerators.Count - 1)];

            if (Char.IsLetterOrDigit(displayChar))
            {
                name = displayChar.ToString();
            }
            else
            {
                name = Controller.GetLocalizedString(nameFunc.Key.ToString());
            }

            return(new FigureTemplate
            {
                Color = c,
                Name = name,
                GeneratorFunc = nameFunc.Value,
                Fill = Utils.GetGradientBrush(c),
                Letter = displayChar.ToString(),
                Effect = Animation.GetRandomBitmapEffect()
            });
        }