public EntityEngineInterface(TileEngine te) { this.te = te; }
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(); }
public void UnloadMap() { CurrentMap = null; CurrentTileEngine = null; }
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; }