Beispiel #1
0
        public ChildGrid(int width, int height, int xOffset, int yOffset, ParentGrid parent, bool showAll) : base(width, height)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("Parent parameter may not be null!");
            }

            this.XOffset       = xOffset;
            this.YOffset       = yOffset;
            this.Parrent       = parent;
            this.VisibleAgents = new AgentBase[width, height];
            this.showAll       = showAll;
        }
Beispiel #2
0
        public static ParentGrid LoadMap(string ScriptPath)
        {
            var engine = Singleton <ScriptEngine> .GetInstance();


            engine.Clear();//destroy old one
            ParentGrid result = null;

            engine.AddHostType(typeof(ParentGrid).Name, typeof(ParentGrid));
            engine.AddHostObject("Map", result);

            var scriptFileContent = File.ReadAllText($"{AppDomain.CurrentDomain.BaseDirectory}{ScriptPath}");

            //  engin.Execute(engin);
            return(null);
        }
Beispiel #3
0
 public static void GetTestMap(out Bitmap bmp, out SakuraBlue.Entities.Map.ParentGrid grid ) {
     TileBase[]  pallet = SakuraBlue.Entities.Map.ParentGrid.GetPallet(typeof(SakuraBlue.Entities.Tiles.Bridge).Assembly);
     var path =  $"{AppDomain.CurrentDomain.BaseDirectory}\\Maps\\map1.bmp";
     bmp =  new Bitmap(path);
     grid = new ParentGrid(path, pallet);       
 }