示例#1
0
        public bool HandleEvent(BaseCharacter player, ActivationTypes activation)
        {
            BasePoint pos = new BasePoint(player.MapLocation.X, player.MapLocation.Y);

            if (activation == ActivationTypes.Activate || activation == ActivationTypes.Collision)
            {
                BasePoint newpt = player.GetLookPoint();
                pos = new BasePoint(pos.X + newpt.X, pos.Y + newpt.Y);

            }

            IMapEvent mapevent = GetEvent(new MapPoint(pos.X, pos.Y));

            if (mapevent != null &&
                (mapevent.Direction == Directions.Any || mapevent.Direction == player.Direction)
                && mapevent.Activation == activation)
            {
                mapevent.Trigger(player);
                return true;
            }

            return false;
        }
示例#2
0
        public static void Initialize(ContentManager content, GraphicsDevice device)
        {
            Check.NullArgument (content, "content");
            Check.NullArgument (device, "device");

            TileEngine.TextureManager = new TextureManager(content, device, "Graphics");
            TileEngine.Player = null; // Cannot assign to abstract class, removed player
            TileEngine.ModuleManager = new ModuleManager();
            TileEngine.Configuration = null;
            TileEngine.WorldManager = new WorldManager();
            TileEngine.NetworkManager = new NetworkClientConnection();
            TileEngine.NetworkPlayerCache = new Dictionary<uint, BaseCharacter>();
            TileEngine.GraphicsDevice = device;
        }
示例#3
0
 public virtual void CenterOnCharacter(BaseCharacter Char)
 {
     this.CenterOnPoint(Char.Location);
 }