Exemple #1
0
 public EntityEngineInterface(TileEngine te)
 {
     this.te = te;
 }
Exemple #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();
        }
Exemple #3
0
 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;
        }