colorshelper.java
来自「Java mulitplayer strategy game. Adaptati」· Java 代码 · 共 44 行
JAVA
44 行
/*
* ColorsHelper.java
*
* Created on 30 pa焏ziernik 2005, 23:19
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package net.sf.jawp.gui.client;
import java.awt.Color;
import net.sf.jawp.api.domain.Planet;
import net.sf.jawp.client.GameData;
/**
*
* @author jarek
*/
public class ColorsHelper
{
private static final Color OWN = new Color( 0.0f, 0.5f, 0.0f);
private static final Color NEUTRAL = Color.GRAY;
private static final Color ENEMY = new Color( 1.0f, 0.2f, 0.2f);
public static final Color getColorFor( final Planet pl, final GameData mgr)
{
if ( mgr.isOwn( pl) )
{
return OWN;
}
if ( mgr.isNeutral( pl ))
{
return NEUTRAL;
}
return ENEMY;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?