Exemplo n.º 1
0
Arquivo: Welt.cs Projeto: pintman/Robi
        /// <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);
        }
Exemplo n.º 2
0
Arquivo: Welt.cs Projeto: pintman/Robi
 public bool EnthaeltPosition(Position point)
 {
     return point.X() >= 0
         && point.X() <= iBreite - 1
         && point.Y() >= 0
         && point.Y() <= iHoehe - 1;
 }
Exemplo n.º 3
0
Arquivo: Welt.cs Projeto: pintman/Robi
 public List<Element> ElementeAnStelle(Position pPosition)
 {
     return elemente.FindAll(el =>
         el.Position().Equals(pPosition));
 }
Exemplo n.º 4
0
 public override Position PunktVor(Position punkt)
 {
     return new Position(punkt.X() + 1, punkt.Y());
 }
Exemplo n.º 5
0
 public void BewegeNach(Position pZiel)
 {
     pPosition = pZiel;
     ElementHatPositionGeaendert();
 }
Exemplo n.º 6
0
 public Element()
 {
     richtung = new RichtungOsten();
     pPosition = new Position(0, 0);
     name = "";
 }