Exemplo n.º 1
0
        public structures.memory findAndDeleteLatest(byte type)
        {
            int foundAt = -1;

            for (int i = list.Length - 1; i >= 0; i--)
            {
                if (list[i].type == type)
                {
                    foundAt = i;
                    break;
                }
            }

            structures.memory retour = new xycv_ppc.structures.memory();

            if (foundAt != -1)
            {
                structures.memory[] buffer = new structures.memory[list.Length];

                list = new structures.memory[buffer.Length - 1];
                for (int i = foundAt; i < list.Length; i++)
                {
                    list[i] = buffer[i + 1];
                }

                for (int i = 0; i < foundAt; i++)
                {
                    list[i] = buffer[i];
                }
            }
            else
            {
                retour     = new xycv_ppc.structures.memory();
                retour.ind = new int[0];
            }

            return(retour);
        }
Exemplo n.º 2
0
		public Memory( PlayerList olayer, int length ) 
		{ 
			this.player = olayer;
			list = new structures.memory[ length ]; 
		} 
Exemplo n.º 3
0
 public Memory(PlayerList olayer, int length)
 {
     this.player = olayer;
     list        = new structures.memory[length];
 }
Exemplo n.º 4
0
		public structures.memory findAndDeleteLatest(byte type)
		{
			int foundAt = -1;

			for ( int i = list.Length - 1; i >= 0; i-- )
				if ( list[ i ].type == type )
				{
					foundAt = i;
					break;
				}

			structures.memory retour = new xycv_ppc.structures.memory();

			if ( foundAt != -1 )
			{
				structures.memory[] buffer = new structures.memory[ list.Length ];

				list = new structures.memory[ buffer.Length - 1 ];
				for ( int i = foundAt; i < list.Length; i++ )
					list[ i ] = buffer[ i + 1 ];

				for ( int i = 0; i < foundAt; i++ )
					list[ i ] = buffer[ i ];
			}
			else
			{
				retour = new xycv_ppc.structures.memory();
				retour.ind = new int[ 0 ];
			}

			return retour;
		}