亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? catfish!.java

?? Catfish ssd2 icarnegie
?? JAVA
字號(hào):
n apimport java.util.*;
/**
 * Basic Catfish - simulates a catfish - can swim and consume 
 * energy in the process.
 * 
 * @author iCarnegie srt
 *Additional code: Diana Cristina Cisneros Ravelo
 */
public class Catfish extends LivingBeing {

    /**
     * The catfish is born "alive". 
     * Then it dies, becoming a corpse. 
     */
    private String ALIVE = "alive";


    /**
     * The catfish is born "alive". 
     * Then it dies, becoming a "dead" corpse. 
     */
    private String DEAD = "dead";



    /**
     * Energy needed to swim in a block of time.
     */
    private int ENERGY_TO_SWIM = 2;
        
    
    
    /**
     * Row-wise location of the catfish
     */
    private int row;


    /**
     * Column-wise location of the catfish
     */
    private int column;


    /**
     * Image of the catfish - is really a filename
     */
    private String imageFileName;

    
    /**
     * Is the catfish dead or alive?
     */
    private String deadOrAlive;
    

    /**
     * Age expressed as blocks of time lived
     */
    private int age;
    private int energy;


    /**
     * The simulation to which this catfish belongs.
     * This is needed so the catfish can send a message 
     * to simulation.
     */
    private Simulation simulation;

    

    /**
     * Constructor. Initialize a catfish to start life at a specified 
     * location with a specified energy. If location is out of bounds,
     * locate the catfish at the nearest edge.
     * 
     * @param initialRow - the row at which the catfish is located
     * @param initialColumn - the column at which the catfish is located
     * @param initialSimulation - the simulation that the catfish belongs to
     */
    public Catfish(
        int initialRow,
        int initialColumn,
        Simulation initialSimulation) {

            simulation = initialSimulation;

            deadOrAlive = ALIVE;    

            age = 0;
            energy = 10;        
            
            imageFileName = "/Catfish-right.gif";   

            row = initialRow;
            column = initialColumn;
    }
    
    /**
     * Get the row at which the catfish is located 
     * 
     * @return - the row of the catfish's location. 
     */     
    public int getRow() {
        return row;
    }

    /**
     * Get the column at which the catfish is located
     * 
     * @return - the column of the catfish's location. 
     */     
    public int getColumn() {
        return column;
    }


    /**
     * get filename of catfish image
     * 
     * @return filename of Catfish image
     */
    public String getImage()
    {
        return imageFileName;
    }


    /**
     * Get the catfish's age
     * 
     * @return the age of the catfish expressed in blocks of time
     */
    public int getAge() {

        // Student:Please complete this method.
        return age;
    }


    /**
     * Get the energy of the catfish
     * 
     * @return current energy level of the catfish
     */
    public int getEnergy() {

        // Student:Please complete this method.
        return energy;
    }
    

    /**
     * Die: The Catfish dies.
     */
    public void die() {

        // Student:Please complete this method. 
        deadOrAlive = DEAD;
        // Set the deadOrAlive attribute to indicate that the catfish is dead.
    }



    /**
     * Is the catfish dead?
     * 
     * @return <code>true</code> if dead. <code>false</code>, otherwise.
     */
    public boolean isDead() {


        if(deadOrAlive == DEAD)
           return true;
        else
           return false;
    }


    
    /** 
     * Swim to a new location if possible.
     * Consumes some energy.
     */
    private void swimIfPossible() {


        // Student:Please complete this method.
        energy = energy - ENERGY_TO_SWIM;

        
        // Consume ENERGY_TO_SWIM units of energy to swim. 

        if (energy >0) {
            row = simulation.getRand().nextInt(10);
            column = simulation.getRand().nextInt(10);
        }
        
        // Check if there is any energy left after consumption.
        

        // Swim at random in one of four directions.
        // Assign a random row location for the Catfish as follows. 
        //
        // (1) Send the "getRand" message to the "simulation" object to get a random number generator. 
        // The "simulation" object is initialized in the constructor above.
        // (2) Send the "nextInt" message to the random number generator obtained above. 
        //
        // The "nextInt" behavior returns an integer between 0(inclusive) and the integer specified as a parameter(exclusive). 
        // Thus, specifiying a value of 10 to the "nextInt" behavior will return an integer between 0 and 9.
        //


        // Similarly, assign a random column location for the catfish
        
    }

    

    /**
     * Catfish lives its life. Dies if it has no energy left.
     */
    public void liveALittle() {

        // Student:Please complete this method.
        if (energy < 1) {
            die();
        }
        

        // If there is no energy left, send a "die" message to this catfish
        
        age = age + 1;
        
        // Increment the age of the Catfish by 1
        
        swimIfPossible();
        
        // Try to swim by sending a "swimIfPossible" message
        
    }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品日韩精品欧美在线| 欧美人动与zoxxxx乱| 久久一区二区三区四区| 黄色成人免费在线| 久久精品在这里| 成人av一区二区三区| 亚洲另类在线视频| 欧美日韩亚洲综合一区| 免费成人av在线| 中文字幕高清一区| 91捆绑美女网站| 午夜精品福利在线| 亚洲精品在线观看视频| 国产精品99久久久久| 亚洲同性同志一二三专区| 欧美性感一区二区三区| 麻豆成人久久精品二区三区小说| 欧美tk—视频vk| 成人免费观看视频| 亚洲成人中文在线| 久久一二三国产| 色婷婷精品大在线视频| 青青草97国产精品免费观看 | 国产精品久久夜| 欧洲日韩一区二区三区| 九九热在线视频观看这里只有精品 | 无码av中文一区二区三区桃花岛| 欧美成人r级一区二区三区| 成人毛片视频在线观看| 天堂蜜桃91精品| 国产女人aaa级久久久级| 91免费看`日韩一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产精品视频观看| 欧美电影在哪看比较好| 成人黄色免费短视频| 日韩国产欧美一区二区三区| 中文av一区二区| 日韩片之四级片| 一本色道综合亚洲| 国产乱码精品一区二区三区五月婷| 亚洲精品久久久蜜桃| 久久伊人中文字幕| 制服丝袜在线91| 色婷婷av一区二区| 国产精品羞羞答答xxdd| 日韩精品欧美成人高清一区二区| 国产精品另类一区| 精品欧美一区二区在线观看| 欧美性猛交xxxx黑人交| 91丨porny丨国产入口| 韩国视频一区二区| 日本视频一区二区| 亚洲一区二区精品久久av| 国产精品视频一二| 久久综合九色综合欧美亚洲| 欧美美女视频在线观看| 色国产精品一区在线观看| 国产成人福利片| 美女国产一区二区| 天天影视涩香欲综合网| 亚洲精品大片www| 中文字幕综合网| 中文字幕国产一区| 国产欧美日韩综合| 亚洲精品高清视频在线观看| 亚洲国产精品精华液ab| 久久亚洲精华国产精华液| 日韩一区二区免费高清| 7777精品伊人久久久大香线蕉| 欧美午夜精品一区二区蜜桃| 色av成人天堂桃色av| 99久久精品免费看国产免费软件| 国产成人综合在线| 福利一区在线观看| 国产精品亚洲一区二区三区在线| 国产一区二区三区在线观看免费视频 | 国产精品久久久久久久久免费樱桃| 久久久国产精华| 久久久亚洲高清| 欧美国产成人精品| 国产精品电影院| 亚洲欧美中日韩| 亚洲欧美电影院| 亚洲永久精品国产| 视频一区欧美日韩| 美女视频一区在线观看| 激情综合网最新| 国产不卡一区视频| 99re亚洲国产精品| 欧美网站大全在线观看| 欧美猛男男办公室激情| 欧美一区二区成人| 久久久久久久久99精品| 国产精品乱码一区二三区小蝌蚪| 亚洲欧美日韩国产一区二区三区| 亚洲一线二线三线视频| 婷婷综合在线观看| 国内精品不卡在线| 91在线精品秘密一区二区| 欧美在线观看你懂的| 91精品国产一区二区| 精品盗摄一区二区三区| 国产精品国产三级国产有无不卡 | 欧美日韩免费观看一区二区三区| 欧美精品v日韩精品v韩国精品v| 欧美精品乱码久久久久久按摩| 日韩免费观看高清完整版| 中文字幕不卡三区| 东方aⅴ免费观看久久av| av一区二区三区| 欧美日韩国产综合久久| 国产亚洲自拍一区| 一卡二卡三卡日韩欧美| 精品在线播放免费| 91在线观看视频| 欧美变态tickle挠乳网站| 中文字幕一区二区三区蜜月| 午夜精品久久久久久久蜜桃app| 国产综合一区二区| 欧美日韩中文字幕精品| 久久久久高清精品| 亚洲国产精品一区二区久久恐怖片| 精品在线播放免费| 欧美曰成人黄网| 国产目拍亚洲精品99久久精品| 性欧美疯狂xxxxbbbb| 成人黄色电影在线| 欧美军同video69gay| 国产精品电影院| 激情久久五月天| 欧美日本一区二区三区四区| 欧美国产日韩一二三区| 免费精品99久久国产综合精品| 91美女在线视频| 3d动漫精品啪啪1区2区免费| 91精品国产综合久久蜜臀| 久久男人中文字幕资源站| 亚洲综合色在线| 丁香婷婷综合网| 精品黑人一区二区三区久久| 亚洲一区二区三区美女| 成人av一区二区三区| 精品捆绑美女sm三区| 亚洲成人av福利| 91丝袜美腿高跟国产极品老师| 国产欧美日韩不卡免费| 久久精品久久精品| 91麻豆精品国产自产在线| 韩国毛片一区二区三区| 欧美日韩视频第一区| 亚洲美女偷拍久久| 99久久精品国产导航| 国产欧美日韩视频在线观看| 久久97超碰色| 日韩视频在线永久播放| 日韩精品免费专区| 制服丝袜成人动漫| 日日摸夜夜添夜夜添国产精品 | 亚洲一区在线看| 91小视频在线免费看| 中文字幕一区二区三区色视频| 成人一道本在线| 亚洲国产成人在线| 丁香桃色午夜亚洲一区二区三区 | 国产人成亚洲第一网站在线播放| 麻豆成人91精品二区三区| 91精品国产福利在线观看| 婷婷中文字幕综合| 欧美一区二区视频在线观看2020 | 91浏览器打开| 亚洲麻豆国产自偷在线| 日本精品一级二级| 亚洲一卡二卡三卡四卡五卡| 欧美日韩综合不卡| 同产精品九九九| 日韩美女视频一区二区在线观看| 日本午夜一本久久久综合| 日韩欧美精品三级| 国产精品影音先锋| 国产精品麻豆欧美日韩ww| 成人不卡免费av| 亚洲一区视频在线| 4438成人网| 国产激情一区二区三区四区| 国产精品嫩草影院av蜜臀| 色综合 综合色| 爽好多水快深点欧美视频| 日韩片之四级片| 成人一区二区三区中文字幕| 亚洲视频小说图片| 欧美日本在线一区| 欧美欧美欧美欧美| 美女www一区二区| 国产欧美日韩中文久久| 欧美亚洲综合色| 精品一区二区成人精品| 日韩一区中文字幕| 欧美一区二区日韩| 懂色一区二区三区免费观看|