platform-list-item.vala 610 Bytes
Newer Older
1
private class Games.PlatformListItem : Games.SidebarListItem {
2 3 4
	private Platform _platform;
	public Platform platform {
		get { return _platform; }
5
		construct {
6
			_platform = value;
7
			label.label = value.get_name ();
8 9 10 11
		}
	}

	public PlatformListItem (Platform platform) {
12
		Object (platform: platform);
13
	}
14

15 16 17 18 19 20
	public override bool has_game (Game game) {
		string game_platform = game.get_platform ().get_name ();

		return (game_platform == platform.get_name ());
	}

21 22 23
	public static int compare (PlatformListItem a, PlatformListItem b) {
		return a.platform.get_name ().collate (b.platform.get_name ());
	}
24
}