diff -r 45b9f25ff611 -r 2fb781bbdd51 project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/TeamIngameAttributes.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/TeamIngameAttributes.java Mon Aug 06 22:39:36 2012 +0200 @@ -0,0 +1,61 @@ +package org.hedgewars.hedgeroid.Datastructures; + +import java.util.ArrayList; +import java.util.Random; + +public final class TeamIngameAttributes { + public static final int[] TEAM_COLORS = { + 0xd12b42, /* red */ + 0x4980c1, /* blue */ + 0x6ab530, /* green */ + 0xbc64c4, /* purple */ + 0xe76d14, /* orange */ + 0x3fb6e6, /* cyan */ + 0xe3e90c, /* yellow */ + 0x61d4ac, /* mint */ + 0xf1c3e1, /* pink */ + /* add new colors here */ + }; + + public final String ownerName; + public final int colorIndex, hogCount; + public final boolean remoteDriven; + + public TeamIngameAttributes(String ownerName, int colorIndex, int hogCount, boolean remoteDriven) { + this.ownerName = ownerName; + this.colorIndex = colorIndex; + this.hogCount = hogCount; + this.remoteDriven = remoteDriven; + } + + public static int randomColorIndex(int[] illegalColors){ + Random rnd = new Random(); + ArrayList legalcolors = new ArrayList(); + for(int i=0; i