Beispiel #1
0
        void MainFormMouseUp(object sender, MouseEventArgs e)
        {
            Node n = graph.getNode(e.X / 10, e.Y / 10);
            Node k = graph.getNode(50, 50);

            if (build_tower)
            {
                g.FillEllipse(Brushes.Red, 50, 50, 20, 20);
                ICollection myCollection = ArrayList.Synchronized(things);
                BasicTower  t1           = new BasicTower(n, graph, 100, 100);

                t1.thinking();
                //t1.action();
                t1.draw(g);

                graph.disableNode(e.X / 10, e.Y / 10);
                lock (myCollection.SyncRoot) {
                    things.Add(t1);
                    Console.WriteLine(things.Count + "DELETE");
                }
                build_tower = false;
            }
            if (build_bug)
            {
                BasicCreature c1 = new BasicCreature(n, k, graph, 100, 100, world);
                build_bug = false;
                things.Add(c1);
                c1.draw(g);
            }

            world.setArray(things);
        }