Exemplo n.º 1
0
 public Line(Vector startPoint, Vector endPoint, Color color)
 {
     StartPoint = startPoint;
     EndPoint   = endPoint;
     this.color = color;
     Le_Engine.RegisterLine(this);
 }
Exemplo n.º 2
0
 public Line(double StartX, double StartY, double EndX, double EndY, Color color)
 {
     StartPoint = new Vector(StartX, StartY);
     EndPoint   = new Vector(EndX, EndY);
     this.color = color;
     Le_Engine.RegisterLine(this);
 }
Exemplo n.º 3
0
 public Shape(Vector Position, Vector Scale, string Tag, Le_Engine.Type type)
 {
     components    = new Components();
     this.Position = Position;
     this.Scale    = Scale;
     this.Tag      = Tag;
     this.type     = type;
     Z             = 0;
     Le_Engine.RegisterShape(this);
 }
Exemplo n.º 4
0
 private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listBox2.SelectedItem != null)
     {
         string item = listBox2.SelectedItem.ToString();
         int    id   = Convert.ToInt32(item.Substring(item.IndexOf('(')).Replace("(", "").Replace(")", ""));
         selectedshape = Le_Engine.GetShapeById(id);
         ConsoleLog("Shape " + selectedshape.Tag + "Selected");
         PopulateProperties(selectedshape);
     }
 }
Exemplo n.º 5
0
        public bool IsAreaColidedWithTag(string Tag, Vector Position, Vector Scale)
        {
            List <Shape> p = Le_Engine.GetShapes(Tag);

            foreach (Shape s in p)
            {
                if (s.Position.Y + s.Scale.Y > Position.Y && Position.Y + Scale.Y > s.Position.Y && s.Position.X + s.Scale.X > Position.X && Position.X + Scale.X > s.Position.X)
                {
                    GetColidedObject = s;
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 6
0
        public bool IsColided(IColision Entity, string tag)
        {
            List <Shape> p = Le_Engine.GetShapes(tag);

            foreach (Shape s in p)
            {
                if (s.Position.Y + s.Scale.Y > Entity.Position.Y && Entity.Position.Y + Entity.Scale.Y > s.Position.Y && s.Position.X + s.Scale.X > Entity.Position.X && Entity.Position.X + Entity.Scale.X > s.Position.X)
                {
                    GetColidedObject = s;
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 7
0
        public static Shape GetClosestShape(Vector Position, string Tag)
        {
            List <Shape> shapes = Le_Engine.GetShapes(Tag);

            if (shapes.Count == 0)
            {
                return(null);
            }
            Shape CurrentClosest = shapes[0];

            foreach (Shape item in shapes)
            {
                if (GetDistance(item.Position, Position) < GetDistance(CurrentClosest.Position, Position))
                {
                    CurrentClosest = item;
                }
            }
            return(CurrentClosest);
        }
Exemplo n.º 8
0
 public void CreateSelf()
 {
     Le_Engine.RegisterShape(this);
 }
Exemplo n.º 9
0
 public void DestroySelf()
 {
     Le_Engine.UnRegisterShape(this);
 }