project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/RoomWithId.java
author Medo <smaxein@googlemail.com>
Sat, 18 Aug 2012 00:47:51 +0200
changeset 7508 763d3961400b
child 7584 7831c84cc644
permissions -rw-r--r--
Hedgeroid: Frantic scrabbling toward the deadline - Added activities for weapon/scheme editors (unfinished) - Completed tablet version of netroom activity - Added map preview - Fixed default team files having the wrong names - Restructuring - Updated frontlib JNA bindings to respect the latest frontlib changes

package org.hedgewars.hedgeroid.Datastructures;

import java.util.Comparator;

public final class RoomWithId {
	public final Room room;
	public final long id;
	
	public RoomWithId(Room room, long id) {
		this.room = room;
		this.id = id;
	}

	@Override
	public String toString() {
		return "RoomWithId [room=" + room + ", id=" + id + "]";
	}
	
	public static final Comparator<RoomWithId> NEWEST_FIRST_ORDER = new Comparator<RoomWithId>() {
		public int compare(RoomWithId lhs, RoomWithId rhs) {
			return rhs.id<lhs.id ? -1 : rhs.id>lhs.id ? 1 : 0;
		}
	};
}