Exemplo n.º 1
0
        private void Initialize(TcpConnectionContract /*.Imp*/ conn)
        {
            // Stash the endpoint into our field
            m_Conn = new TRef/*<TcpConnectionContract.Imp>*/ (conn);

            // Create an empty data buffer...
            m_DataBuffer = new TrackedBytesBuffer();
        }
Exemplo n.º 2
0
 internal override void Dispose()
 {
     if (m_Conn != null)
     {
         TcpConnectionContract /*.Imp*/ conn = (TcpConnectionContract)(m_Conn.Acquire());
         //delete conn;
         m_Conn = null;
     }
 }
Exemplo n.º 3
0
        public Nic(NicDeviceContract /*.Imp*/ nicImp,
                   NicDeviceProperties np,
                   string nicName)
        {
            this.nicChannel = new TRef(nicImp);
            //assume np.DriverName != null;
            //assume np.MacAddress != null;
            this.driverName              = np.DriverName;
            this.driverVersion           = np.DriverName;
            this.macAddress              = np.MacAddress;
            this.nicName                 = nicName;
            this.mtu                     = np.MtuBytes;
            this.maxTxPacketsInDevice    = np.MaxTxPacketsInDevice;
            this.maxRxPacketsInDevice    = np.MaxRxPacketsInDevice;
            this.maxTxFragmentsPerPacket = np.MaxTxFragmentsPerPacket;
            this.maxRxFragmentsPerPacket = np.MaxRxFragmentsPerPacket;

            this.muxEvent = new AutoResetEvent(false);
            // The following attributes are both integers yet
            // sgc is complaining it doesn't know to use
            // Math.Min(sbyte, sbyte) or Math.Min(byte, byte).
            int rxFifoSize = Math.Min(np.MaxRxPacketsInDevice,
                                      (int)Nic.MaxRxPacketsInDevice);

            this.rxFifo =
                new ExRefPacketFifo(
                    new PacketFifo(rxFifoSize),
                    false
                    );

            // The following attributes are both integers yet
            // sgc is complaining it doesn't know to use
            // Math.Min(sbyte, sbyte) or Math.Min(byte, byte).
            int txFifoSize = Math.Min(np.MaxTxPacketsInDevice,
                                      (int)Nic.MaxTxPacketsInDevice);

            this.txFifo =
                new ExRefPacketFifo(
                    new PacketFifo(txFifoSize),
                    true
                    );

            this.txFreeFifo =
                new ExRefPacketFifo(
                    new PacketFifo(txFifoSize),
                    true
                    );

            this.txCoalesceFifo =
                new ExRefPacketFifo(
                    new PacketFifo(txFifoSize),
                    true
                    );

            TxProvision();
            RxProvision();
        }
Exemplo n.º 4
0
 // Must be balanced with a call to ReleaseIPConnection()!
 internal static IPContract /*.Imp*/ GetIPConnection()
 {
     using (IPSlotLock.Lock()) {
         if (IPSlot == null)
         {
             IPSlot = new TRef(new IPContract());
         }
     }
     return((IPContract)(IPSlot.Acquire()));
 }
Exemplo n.º 5
0
 // Must be balanced with a call to ReleaseDnsConnection()!
 internal static DNSContract /*.Imp*/ GetDnsConnection()
 {
     using (DnsSlotLock.Lock()) {
         if (DnsSlot == null)
         {
             DnsSlot = new TRef(new DNSContract());
         }
     }
     return((DNSContract)(DnsSlot.Acquire()));
 }
Exemplo n.º 6
0
 public PortalComponent(Game game, Texture2D tsheet, TRef Frame, TManager manager, Vector2 pos) : base(game)
 {
     texture      = tsheet;
     Position     = pos;
     myframe      = Frame;
     myManager    = manager;
     imageRect    = new Rectangle(myframe.TLocX, myframe.TLocY, 128, 128);
     boundingRect = new Rectangle(Position.ToPoint(), imageRect.Size);
     game.Components.Add(this);
 }
 public CollectableComponent(Game game, Texture2D tsheet, TRef Frame, TManager manager, Vector2 pos) : base(game)
 {
     texture   = tsheet;
     Position  = pos;
     myframe   = Frame;
     myManager = manager;
     //get the reference on the tile sheet for the collectable
     imageRect    = new Rectangle(myframe.TLocX, myframe.TLocY, 128, 128);
     boundingRect = new Rectangle(Position.ToPoint(), imageRect.Size);
     game.Components.Add(this);
 }
Exemplo n.º 8
0
        // Copy data out into a supplied buffer. If fPeek is true, it means we
        // would copy out the exact same bytes if called again.
        public int CopyFromHead(byte[] buffer, int offset, int length, bool fPeek)
        {
            int bytesCopied = 0;

            while ((m_DataQueue.Count > 0) && (bytesCopied < length))
            {
                // Don't dequeue just yet, just peek
                TRef wrapper = (TRef)m_DataQueue.Peek();
                VTable.Assert(wrapper != null); // Because we checked the count
                BytesPlusCount topChunk = (BytesPlusCount)(wrapper.Acquire());

                int copied = topChunk.CopyOut(buffer, offset + bytesCopied,
                                              length - bytesCopied, fPeek);
                bytesCopied += copied;

                if ((!fPeek) && (topChunk.Empty))
                {
                    // We want to throw away the top chunk. To take pressure off
                    // the finalizer, we'll explicitly free the ExHeap data vector.
                    topChunk.Dispose();
                    m_DataQueue.Dequeue();
                }
                else if ((!fPeek) && (!topChunk.Empty))
                {
                    // This should only happen because we filled up the
                    // caller's buffer
                    Debug.Assert(bytesCopied == length);
                    // Put the data back into its wrapper
                    wrapper.Release(topChunk);
                }
                else
                {
                    // Release topChunk back
                    wrapper.Release(topChunk);
                }
            }

            if (!fPeek)
            {
                m_Count -= bytesCopied;
                Debug.Assert(m_Count >= 0);
            }

            return(bytesCopied);
        }
Exemplo n.º 9
0
 internal IntelEventRelay(
     NicDeviceEventContract /*.Exp*/ ep)
 {
     channel       = new TRef(ep);
     channelClosed = false;
 }
Exemplo n.º 10
0
        // ================ Private Methods ================

        private void Initialize(UdpConnectionContract /*.Imp*/ conn)
        {
            m_Conn = new TRef/*<UdpConnectionContract.Imp>*/ (conn);
        }
Exemplo n.º 11
0
        public TRender(Game game) : base(game)
        {
            tSheet = Game.Content.Load <Texture2D>
                         ("Sprites/TileSheet3"); // get TileSheet

            tsWidth  = tSheet.Width / tsColumns; // gets Width of tiles
            tsHeight = tSheet.Height / tsRows;   // gets Height of tiles

            _current = LevelStates.LevelOne;

            #region Tile Maps
            // Level 1
            tileMap = new int[, ]
            {
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 1, 1, 1, 1, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 16, 1, 1, 17, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 13, 1, 0, 74, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 12, 0, 0, 74, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 13, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, },
                { 80, 80, 0, 0, 0, 0, 0, 74, 74, 0, 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, 0, 2, 2, 1, 1, 1, 1, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
                { 2, 70, 0, 0, 0, 0, 0, 77, 77, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 2, 1, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 1, 1, 1, 2, 2, },
                { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, },
                { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, },
            };

            // level 2
            tileMap2 = new int[, ]
            {
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 34, 31, 31, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 26, 3, 25, 0, 0, 0, 26, 4, 4, 25, 0, 0, 0, 0, 0, 0, 29, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 67, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 3, 3, 30, 0, 0, 0, 0, 29, 3, },
                { 3, 3, 30, 0, 0, 0, 0, 0, 4, 4, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, },
                { 4, 4, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 75, 0, },
                { 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 78, 0, },
                { 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 75, 0, 0, 0, 3, 3, 3, },
                { 4, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 75, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 3, 3, 4, 4, 4, 4, 4, },
                { 68, 0, 78, 78, 3, 3, 3, 0, 0, 0, 0, 4, 3, 25, 0, 0, 29, 3, 30, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
                { 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 26, 3, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 26, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
                { 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
                { 4, 4, 75, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
                { 4, 4, 78, 75, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
                { 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 3, 3, 3, 0, 0, 0, 29, 3, 30, 0, 0, 0, 0, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, },
            };

            // level 3
            tileMap3 = new int[, ]
            {
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 5, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 35, 5, 36, 0, 0, 0, 35, 5, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 73, 0, 0, 0, 0, 0, 0, },
                { 0, 76, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 5, 5, 5, 5, 5, 5, 5, 5, },
                { 0, 35, 5, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 5, 5, 5, 5, 0, 0, 0, 0, 0, 37, 7, 7, 7, 7, 7, 7, 7, 7, 7, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 39, 5, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 5, 36, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 0, 0, 0, 0, 0, 35, 5, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 5, 5, 5, 0, 0, 0, 0, 73, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 39, 5, 5, 5, 5, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, },
                { 6, 6, 6, 5, 5, 0, 0, 76, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
                { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, },
            };

            // level 4
            tileMap4 = new int[, ]
            {
                { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 7, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                { 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 7, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, },
            };

            #endregion

            game.Components.Add(this);

            tileManager = new TManager();

            //TRefs needed to be passed into Component classes to be drawn, had to be multiplied by 128, the size of the tiles
            Collectable  = new TRef(128 * 8, 128, 64);
            GoldenGem    = new TRef(0, 0, 82);
            ClosedPortal = new TRef(128 * 8, 128 * 2, 67);
            OpenPortal   = new TRef(128 * 9, 128 * 2, 68);

            //Enemies
            SlugEnemy = new TRef(8 * 128, 0, 61);  // Slug Enemy
            Alien     = new TRef(9 * 128, 0, 62);  // Alien Shooter
            BombBoy   = new TRef(10 * 128, 0, 63); // BombBoy
        }