Fehlerkorrektur 2

LALALALALALALA
pull/61/head
SariusRu 8 years ago
parent 7ac3e274c2
commit 02457ffeaf

@ -556,6 +556,7 @@ public abstract class GeneralMap extends World implements ButtonEvent
if (provinces[i].hasClicked() == true) if (provinces[i].hasClicked() == true)
{ {
offenderProvince = provinces[i]; offenderProvince = provinces[i];
provinces[i].redrawProvince(2);
// System.out.println("Die Provinz " + provinces[i].getDisplayName() + " wurde als angreifende Provinz ausgewählt! Sie gehört Spieler" + provinces[i].getOwner()); // System.out.println("Die Provinz " + provinces[i].getDisplayName() + " wurde als angreifende Provinz ausgewählt! Sie gehört Spieler" + provinces[i].getOwner());
} }
} }
@ -569,6 +570,7 @@ public abstract class GeneralMap extends World implements ButtonEvent
if (provinces[i].hasClicked() == true)//&& defenderProvince != offenderProvince) if (provinces[i].hasClicked() == true)//&& defenderProvince != offenderProvince)
{ {
defenderProvince = provinces[i]; defenderProvince = provinces[i];
provinces[i].redrawProvince(3);
// System.out.println("Die Provinz " + provinces[i].getDisplayName() + " wurde als verteidigende Provinz ausgewählt! Sie gehört Spieler" + provinces[i].getOwner()); // System.out.println("Die Provinz " + provinces[i].getDisplayName() + " wurde als verteidigende Provinz ausgewählt! Sie gehört Spieler" + provinces[i].getOwner());
chooser(); chooser();
break; break;

@ -146,36 +146,58 @@ public class Province extends Actor
public int addToEntities(int a) { public int addToEntities(int a) {
eCount = eCount + a; eCount = eCount + a;
checkEntityCount(); checkEntityCount();
redrawProvince(); redrawProvince(1);
return eCount; return eCount;
} }
public int removeFromEntities(int a) { public int removeFromEntities(int a) {
eCount = eCount - a; eCount = eCount - a;
checkEntityCount(); checkEntityCount();
redrawProvince(); redrawProvince(1);
return eCount; return eCount;
} }
public int setEntityCount(int a) { public int setEntityCount(int a) {
eCount = a; eCount = a;
checkEntityCount(); checkEntityCount();
redrawProvince(); redrawProvince(1);
return eCount; return eCount;
} }
public void redrawProvince() public void redrawProvince()
{
redrawProvince(1);
}
public void redrawProvince(int ColorInt)
{ {
int textSize; int textSize;
textSize = 20; textSize = 20;
GreenfootImage province = new GreenfootImage(120,100); GreenfootImage province = new GreenfootImage(120,100);
if(ColorInt ==1)
{
GreenfootImage provinceName = new GreenfootImage(displayName,textSize,new Color(0,0,0),new Color(1.0f,1.0f,1.0f,0.5f)); GreenfootImage provinceName = new GreenfootImage(displayName,textSize,new Color(0,0,0),new Color(1.0f,1.0f,1.0f,0.5f));
province.drawImage(provinceName,0,0); province.drawImage(provinceName,0,0);
setImage(province); setImage(province);
oDecide(province,textSize,owner,eCount); oDecide(province,textSize,owner,eCount);
}
if(ColorInt ==2)
{
GreenfootImage provinceName = new GreenfootImage(displayName,textSize,new Color(0,0,0),Color.GREEN);
province.drawImage(provinceName,0,0);
setImage(province);
oDecide(province,textSize,owner,eCount);
}
if(ColorInt == 3)
{
GreenfootImage provinceName = new GreenfootImage(displayName,textSize,new Color(0,0,0),Color.RED);
province.drawImage(provinceName,0,0);
setImage(province);
oDecide(province,textSize,owner,eCount);
} }
}
public void oDecide(GreenfootImage province,int textSize, int owner, int eCount) public void oDecide(GreenfootImage province,int textSize, int owner, int eCount)
{ {
String ownerString; String ownerString;
@ -516,7 +538,6 @@ public class Province extends Actor
setImage(province); setImage(province);
} }
public boolean hasClicked() public boolean hasClicked()
{ {
boolean b = clicked; boolean b = clicked;

Loading…
Cancel
Save