Пример #1
0
        /// <summary>
        /// Transformiert die logischen Koordinaten auf Bildschirmpixel.
        /// </summary>
        private Point TransformiereKoordinaten(Graphics g, Position punkt)
        {
            int iSchrittweiteX = Convert.ToInt32(g.VisibleClipBounds.Width / this.iBreite);
            int iSchrittweiteY = Convert.ToInt32(g.VisibleClipBounds.Height / this.iHoehe);

            return new Point(punkt.X() * iSchrittweiteX, punkt.Y() * iSchrittweiteY);
        }
Пример #2
0
 public bool EnthaeltPosition(Position point)
 {
     return point.X() >= 0
         && point.X() <= iBreite - 1
         && point.Y() >= 0
         && point.Y() <= iHoehe - 1;
 }
Пример #3
0
 public List<Element> ElementeAnStelle(Position pPosition)
 {
     return elemente.FindAll(el =>
         el.Position().Equals(pPosition));
 }
Пример #4
0
 public override Position PunktVor(Position punkt)
 {
     return new Position(punkt.X() + 1, punkt.Y());
 }
Пример #5
0
 public void BewegeNach(Position pZiel)
 {
     pPosition = pZiel;
     ElementHatPositionGeaendert();
 }
Пример #6
0
 public Element()
 {
     richtung = new RichtungOsten();
     pPosition = new Position(0, 0);
     name = "";
 }