示例#1
0
        public State Execute(State state)
        {
            var box = new UmlUser(pos, text);

            state.Model.Objects.Add(box);
            state.SelectedId           = box.Id;
            state.SelectedIndexInModel = state.Model.Objects.Count - 1;
            return(state);
        }
示例#2
0
        private static void PaintUmlUser(Canvass canvass, UmlUser user, bool paintSelectableIds)
        {
            var gfx = @"
,-.
`-'
/|\
 |
/ \
" + (user.Text ?? "");

            var lines = gfx.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            lines.Each((line, row) => Canvass.PaintString(canvass, line, user.Pos.X, user.Pos.Y + row, user.Id));

            if (paintSelectableIds)
            {
                canvass.RawPaintString(user.Id.ToString(), user.Pos, ConsoleColor.DarkGreen, ConsoleColor.Green);
            }
        }