Esempio n. 1
0
 public MouseHelper(LogicGraph game)
     : base(game)
 {
     MouseManager = new MouseManager(game);
     CurrentHelper = this;
     this.UpdateOrder = -1;
 }
Esempio n. 2
0
 public Screen(LogicGraph game)
     : base(game)
 {
     this.Screen = null;
     this.Components.ItemAdded += Components_ItemAdded;
     this.Components.ItemRemoved += Components_ItemRemoved;
 }
Esempio n. 3
0
 public static void DrawLine(Vector2 p1, Vector2 p2, Texture2D line, LogicGraph game, Color color, RoadDisplayMode mode = RoadDisplayMode.Direct)
 {
     Vector2 m1, m2;
     switch (mode)
     {
         case RoadDisplayMode.Direct:
         default:
             game.SpriteBatch.Draw(line, p1, new Rectangle(0, 2, (int)((p2 - p1).Length()), 4)
                 , color, getAngle(p1, p2), Vector2.Zero, 1, SpriteEffects.None, 0);
             break;
         case RoadDisplayMode.DownTuring:
             m1 = new Vector2(p1.Y > p2.Y ? p2.X : p1.X, Math.Max(p1.Y, p2.Y));
             game.SpriteBatch.Draw(line, p1, new Rectangle(0, 2, (int)((m1 - p1).Length()), 4)
                 , color, getAngle(p1, m1), Vector2.Zero, 1, SpriteEffects.None, 0);
             game.SpriteBatch.Draw(line, p2, new Rectangle(0, 2, (int)((m1 - p2).Length()), 4)
                 , color, getAngle(p2, m1), Vector2.Zero, 1, SpriteEffects.None, 0);
             break;
         case RoadDisplayMode.UpTurning:
             m1 = new Vector2(p1.Y < p2.Y ? p2.X : p1.X, Math.Min(p1.Y, p2.Y));
             game.SpriteBatch.Draw(line, p1, new Rectangle(0, 2, (int)((m1 - p1).Length()), 4)
                 , color, getAngle(p1, m1), Vector2.Zero, 1, SpriteEffects.None, 0);
             game.SpriteBatch.Draw(line, p2, new Rectangle(0, 2, (int)((m1 - p2).Length()), 4)
                 , color, getAngle(p2, m1), Vector2.Zero, 1, SpriteEffects.None, 0);
             break;
     }
 }
Esempio n. 4
0
 public Road(LogicGraph game, RoadBase data)
     : base(game)
 {
     RodeData = data;
     this.Position = new Vector2(data.Node1.Position.Item1
         + data.Node2.Position.Item1, data.Node1.Position.Item2 + data.Node2.Position.Item2) / 2;
     this.Size = new Size2();
     Color = Color.Green;
     this.DrawOrder = 0;
 }
Esempio n. 5
0
        public GameScreen(LogicGraph game)
            : base(game)
        {
            Resource = new ResourceManager();
            btnnode = new Button(game, "Button110.png", "Add Node", Vector2.Zero, new Size2(110, 30), null, Color.White);
            btnroad = new Button(game, "Button110.png", "Add Road", new Vector2(110, 0), new Size2(110, 30), null, Color.White);
            btnrenode = new Button(game, "Button150.png", "Remove Node", new Vector2(220, 0), new Size2(150, 30), null, Color.White);
            btnrerode = new Button(game, "Button150.png", "Remove Road", new Vector2(370, 0), new Size2(150, 30), null, Color.White);
            btnnode.Click += btnnode_Click;
            btnroad.Click += btnroad_Click;
            btnrenode.Click += btnrenode_Click;
            btnrerode.Click += btnrerode_Click;

            this.OnButtonUp += GameScreen_OnButtonUp;

            map = new Map();
        }
Esempio n. 6
0
 public Node(LogicGraph game, NodeBase data)
     : base(game)
 {
     NodeData = data;
     this.DrawOrder = 1;
 }
Esempio n. 7
0
 static void Main()
 {
     LogicGraph game = new LogicGraph();
     game.Run();
 }
Esempio n. 8
0
 public GameElement(LogicGraph game)
     : base(game)
 {
     laststate = false;
     lasthover = false;
 }
Esempio n. 9
0
 public DrawableGameComponent(LogicGraph game)
     : base(game)
 {
 }
Esempio n. 10
0
 public ScreenManager(LogicGraph game)
     : base(game)
 {
 }