示例#1
0
        protected void DrawSelectedShap(AreaShape areaShape, DrawingContext dc)
        {
            Matrix tmatrix = areaShape.ScaleMatrix * this.Matrix;
            Rect   rect    = new Rect(areaShape.Location, areaShape.Size);

            rect.Transform(tmatrix);
            Pen pen = new Pen(Brushes.Red, 1);

            dc.DrawRectangle(null, pen, rect);
            Point[] pts = new Point[]
            {
                rect.TopLeft,
                rect.TopLeft + new Vector(rect.Width / 2, 0),
                rect.TopRight,
                rect.TopLeft + new Vector(0, rect.Height / 2),
                rect.TopRight + new Vector(0, rect.Height / 2),
                rect.BottomLeft,
                rect.BottomLeft + new Vector(rect.Width / 2, 0),
                rect.BottomRight
            };
            foreach (Point pt in pts)
            {
                dc.DrawEllipse(Brushes.Red, pen, pt, 5, 5);
            }
        }
示例#2
0
 protected void AssignProperties()
 {
     if (horizontalPickup)
     {
         changeShape = AreaShape.Horizontal;
     }
     if (verticalPickup)
     {
         changeShape = AreaShape.Vertical;
     }
     if (crossPickup)
     {
         changeShape = AreaShape.Cross;
     }
     if (plus10Percent)
     {
         percentAmount = 0.1f;
     }
     if (plus25Percent)
     {
         percentAmount = 0.25f;
     }
     if (plus50Percent)
     {
         percentAmount = 0.5f;
     }
 }
示例#3
0
 public Torch(IDriver driver) : base(driver)
 {
     enlight = driver.GetFilter("enlight");
     fire    = driver.GetAnimation("fire");
     shape   = new AreaShape(-1, -1, 1, 1);
 }
示例#4
0
 protected void PerformEat(AreaShape setShape)
 {
     //Todo: Call a public method in the child to call these private methods
     //gameManager.SetArea((int)setShape);
 }