Beispiel #1
0
        static void Main(string[] args)
        {
            int i=0;

            if(!File.Exists("TPDT.LogicGraph.Default.dll"))
            {
                Console.WriteLine("no dll");
                Console.ReadKey();
            }

            Assembly ass = Assembly.LoadFrom("TPDT.LogicGraph.Default.dll");

            ResourceManager rm = new ResourceManager();
            rm.LoadedAssemblys.Add(ass);
            rm.NodeDefinitions.Add(i, new NodeDefinition()
            {
                DefaultDescription = "this is a node",
                DefaultName = "Node",
                Id = i++,
                EntityType = typeof(DefaultNode).FullName,
            });

            i = 0;
            rm.ArmyDefinitions.Add(i, new ArmyDefinition()
            {
                DefaultAttack = 1,
                DefaultAttackRange = 1,
                DefaultMove = 1,
                DefaultDescription = "this is a soilder",
                DefaultName = "Soilder",
                Id = i++,
                EntityType = typeof(Soilder).FullName,
            });

            i = 0;
            rm.CardDefinitions.Add(i, new CardDefinition()
            {
                DefaultDescription = "this is a card",
                DefaultName = "Soilder",
                Id = i++,
                EntityType = typeof(Spirit).FullName,
            });
            rm.CardDefinitions[0].Tags.Add("AttackIncrement", "1");
            rm.CardDefinitions[0].Tags.Add("Span", "1");

            rm.RoadDefinitions.Add(0, typeof(TwoWayRoad).FullName);

            rm.Save("default.def");

            ResourceManager r = new ResourceManager();
            r.Load("default.def");

            NodeBase nd = NodeBase.CreateNode(r.NodeDefinitions[0], new Tuple<float, float>(0, 0));

            Console.ReadKey();
        }
 public ResourceManager()
 {
     ArmyDefinitions = new Dictionary<int, ArmyDefinition>();
     CardDefinitions = new Dictionary<int, CardDefinition>();
     NodeDefinitions = new Dictionary<int, NodeDefinition>();
     RoadDefinitions = new Dictionary<int, string>();
     LoadedArmys = new Dictionary<string, Type>();
     LoadedCards = new Dictionary<string, Type>();
     LoadedNodes = new Dictionary<string, Type>();
     LoadedRoads = new Dictionary<string, Type>();
     LoadedAssemblys = new List<Assembly>();
     ResourceManager.CurrentResouceManager = this;
 }
Beispiel #3
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();
        }