Beispiel #1
0
 public static bool CheckForObjInWorld(Pos2D position, out Gameobjekt gameobjekt)
 {
     if (GoThroughAllObj(Game.gameObjList, position, out gameobjekt))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #2
0
 private static bool GoThroughAllObj(List <Gameobjekt> gameobjekts, Pos2D position, out Gameobjekt gameobjektHit)
 {
     //gameobjektHit = new Gameobjekt();
     Dev.Dis(gameobjekts.Count());
     foreach (Gameobjekt item in gameobjekts)
     {
         if (item.position.Equals(position))
         {
             gameobjektHit = item;
             return(true);
         }
     }
     gameobjektHit = null;
     return(false);
 }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            Pos2D other = obj as Pos2D;

            if (other == null)
            {
                return(false);
            }

            if (this.x != other.x || this.y != other.y)
            {
                return(false);
            }

            return(true);
        }
Beispiel #4
0
 public static float Distens(Pos2D point1, Pos2D point2)
 {
     return(MathF.Sqrt(MathF.Pow((point2.x - point1.x), 2) + MathF.Pow((point2.y - point1.x), 2)));
 }