Пример #1
0
 public EntityEngineInterface(TileEngine te)
 {
     this.te = te;
 }
Пример #2
0
        public void SwitchMap(String mapname, String startLoc)
        {
            UnloadMap();

            CurrentMap = new Map(mapname,this);
            CurrentMap.initTextures();
            CurrentTileEngine = new TileEngine(CurrentMap);
            CurrentMap.scriptHandler.InvokeOnload(startLoc);
            playerInput.UnpressAll();
        }
Пример #3
0
 public void UnloadMap()
 {
     CurrentMap = null;
     CurrentTileEngine = null;
 }
Пример #4
0
        public bool ZoneInvoke(Entity activator, TileEngine.Zone zone)
        {
            if (mapScript != null && zone.script != null)
            {
                try
                {
                    MethodInfo mi = mapScriptType.GetMethod(
                        zone.script,
                        BindingFlags.IgnoreCase |
                        BindingFlags.Instance |
                        BindingFlags.Public |
                        BindingFlags.FlattenHierarchy
                    );

                    if (mi != null)
                    {
                        ScriptActivationArgs saa = new ScriptActivationArgs();
                        saa.activator = activator;
                        saa.activatedZone = zone;
                        saa.scriptName = zone.script;

                        mapScript.setArgs(saa);

                        mi.Invoke(mapScript, new object[] { });
                        return true;
                    }
                    else
                    {
                        Console.WriteLine("WARNING: Failed to find matching method for event '{0}'", zone.script);
                    }
                }
                catch (AmbiguousMatchException ex)
                {
                    Console.WriteLine("WARNING: Found multiple matching methods.", ex);
                }
            }
            return false;
        }