示例#1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="spriteBatch"></param>
 /// <param name="content"></param>
 /// <param name="displayRect"></param>
 public UIElement(Backend.IHandleEvent parent, SpriteBatch spriteBatch, ContentManager content, Rectangle displayRect)
 {
     _displayRect = displayRect;
     _spriteBatch = spriteBatch;
     _content = content;
     _parent = parent;
 }
示例#2
0
 public Projectile(uint id, Backend.IHandleEvent parent, Backend.Coords current, Backend.Direction dir, ProjectileTile tile)
 {
     _dir = dir;
     _id = id;
     _tile = tile;
     _current = Mainmap._map2screen(current);
     _target = Mainmap._map2screen(current);
     //     System.Diagnostics.Debug.WriteLine("Start at" + _current);
     _parent = parent;
 }
示例#3
0
        public NetPlayer(Backend.IHandleEvent parent)
        {
            _config = new NetPeerConfiguration("DungeonCrawler");
            _config.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);
            _config.EnableMessageType(NetIncomingMessageType.ConnectionApproval);

            _config.UseMessageRecycling = true;
            _config.PingInterval = 0.25f;
            _config.ConnectionTimeout = 20f;
            _config.MaximumHandshakeAttempts = 3;
            _config.ResendHandshakeInterval = 5;
            _parent = parent;
            _servers = new Dictionary<string, string>();
            Start();
        }
示例#4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="spritebatch"></param>
 /// <param name="name"></param>
 /// <param name="controllable"></param>
 /// <param name="position"></param>
 /// <param name="sprite"></param>
 public ActorView(Camera camera, Backend.IHandleEvent parent, int id, ContentManager content, Backend.Coords position, Backend.Actor actor, string filename = "", int speed = 5, bool alive = true, int width = 96, int height = 96)
     : base(content, width, height, "")
 {
     _camera = camera;
     _position = position;
     _actor = actor;
     _id = id;
     _speed = speed;
     _target = new Backend.Coords((int)position.x, (int)position.y);
     for (int i = 0; i < (Enum.GetValues(typeof(Backend.Activity)).Length) * 8; ++i)
     {
         _textures.Add(new TileObject(_content, _width, _height));
     }
     if (filename != "")
     {
         Load(filename);
     }
     _parent = parent;
     if (!alive)
     {
         Kill();
     }
 }