Example #1
0
        internal void AddItem(uint itemID, int x, int y, double z, double height, byte state)
        {
            lock (syncRoot)
            {
                if (map[x, y] == null)
                    map[x, y] = new OrderedArray<double, StackItem>(1, SortType.Ascending);

                map[x, y].Insert(z, new StackItem(height + z, z, itemID, state));
            }
        }
Example #2
0
        internal EventCategory(int categoryID)
        {
            this.categoryID = categoryID;

            this.events = new Dictionary<RoomData, int>();
            this.orderedEventRooms = new OrderedArray<RoomData>(40);
            this.addQueue = new Queue();
            this.removeQueue = new Queue();
            this.updateQueue = new Queue();
        }
Example #3
0
        public RoomCategory(int categoryID, string caption)
        {
            this.categoryID = categoryID;
            this.caption = caption;

            this.activeRooms = new Dictionary<RoomData, int>();
            this.orderedRooms = new OrderedArray<RoomData>(40);

            this.addActiveRoomQueue = new Queue();
            this.updateActiveRoomQueue = new Queue();
            this.removeActiveRoomQueue = new Queue();
        }
Example #4
0
        public EventManager()
        {
            this.eventCategories = new Dictionary<int, EventCategory>();
            this.events = new Dictionary<RoomData, int>();
            this.orderedEventRooms = new OrderedArray<RoomData>(40);
            this.addQueue = new Queue();
            this.removeQueue = new Queue();
            this.updateQueue = new Queue();

            for (int i = 0; i < 30; i++)
            {
                eventCategories.Add(i, new EventCategory(i));
            }
        }
Example #5
0
        static void Main(string[] args)
        {
            OrderedArray testArray = new OrderedArray(10);

            testArray.insert(1);
            testArray.insert(3);
            testArray.insert(2);
            testArray.insert(30);
            testArray.insert(15);
            testArray.insert(12);
            testArray.insert(-4);
            testArray.insert(-5);
            Console.WriteLine("Please insert a value that you are looking for to get its index back:");
            int userindex = Convert.ToInt32(Console.ReadLine());
            int value = testArray.Find(userindex);
            if (value == -1)
                Console.WriteLine("Your value does not exist in the array");
            else
                Console.WriteLine("This is the index for {0}: {1}", userindex ,value);

            testArray.Display();

            Console.Read();
        }
 static void Main(string[] args)
 {
     OrderedArray.Test();
 }
Example #7
0
        internal RoomManager()
        {
			this.loadedRooms = new Dictionary<uint, Room>(5839);

            this.roomModels = new Hashtable();
            this.mToRemove = new List<Room>();
            this.roomCategories = new Dictionary<int, RoomCategory>();

			this.votedRooms = new Dictionary<RoomData, int>(5839);
			this.activeRooms = new Dictionary<RoomData, int>(5839);
            this.orderedActiveRooms = new OrderedArray<RoomData>(40);
            this.orderedVotedRooms = new OrderedArray<RoomData>(40);
            this.CachedRoomdata = new Dictionary<uint, RoomData>();

            this.roomsToAddQueue = new Queue();
            this.roomsToRemoveQueue = new Queue();

            this.votedRoomsRemoveQueue = new Queue();
            this.votedRoomsAddQueue = new Queue();

            this.activeRoomsRemoveQueue = new Queue();
            this.activeRoomsUpdateQueue = new Queue();
            this.activeRoomsAddQueue = new Queue();
			this.roomLoadQueue = new Queue();

            this.eventManager = new EventManager();

            this.roomCycleStopwatch = new Stopwatch();
            this.removeTaskStopwatch = new Stopwatch();
            this.roomCycleStopwatch.Start();
            this.roomCycleStopwatch.Start();

        }
Example #8
0
 public Stackmap(int dimensionX, int dimensionY)
 {
     this.map = new OrderedArray<double, StackItem>[dimensionX, dimensionY];
     this.syncRoot = new object();
 }