Пример #1
0
        public void Click(ScreenCanvas canvas, Point location)
        {
            var placement = new Common.EntityPlacement() {
                entity = _entity.Name,
                direction = Common.Direction.Unknown,
                screenX = location.X,
                screenY = location.Y
            };

            canvas.Screen.AddEntity(placement);

            canvas.Screen.Stage.PushHistoryAction(new AddEntityAction(placement, canvas.Screen));
        }
        public void Click(ScreenCanvas canvas, Point location)
        {
            var snappedPoint = new Point(
                (location.X / _snapX) * _snapX,
                (location.Y / _snapY) * _snapY);

            var placement = new Common.EntityPlacement()
            {
                entity    = _entity.Name,
                direction = Common.Direction.Unknown,
                screenX   = snappedPoint.X,
                screenY   = snappedPoint.Y
            };

            canvas.Screen.AddEntity(placement);

            canvas.Screen.Stage.PushHistoryAction(new AddEntityAction(placement, canvas.Screen));
        }