battle programmers alliance
Would you like to react to this message? Create an account in a few clicks or log in to continue.


battle programming a forum for elite programmers with extreme will power to sharpen their skills
 
HomeGallerySearchRegisterLog in
 

 DiPrefer convo beef up skill

Go down 
AuthorMessage
Moti Barski
super
super
Moti Barski

Posts : 568
Join date : 2011-08-02

DiPrefer convo beef up skill Empty
PostSubject: DiPrefer convo beef up skill   DiPrefer convo beef up skill EmptySat Feb 13, 2021 8:06 am

Code:
package com.yotamarker.lgkotlin1;

import java.util.ArrayList;

public class DiPrefer extends DISkill {
    private String loves = "nothing";
    private String hates = "creamed salad";
    private String reply = "";
    private DISkillUtils diSkillUtils = new DISkillUtils();

    public DiPrefer(Kokoro kokoro) {
        super(kokoro);
        String l1 = kokoro.grimoireMemento.simpleLoad("diprefer_loves");
        if(l1.equals("null")||l1.isEmpty()){this.loves="tea";}
        String h1 = kokoro.grimoireMemento.simpleLoad("diprefer_hates");
        if(h1.equals("null")||h1.isEmpty()){this.hates="fudge";}
    }

    @Override
    public void input(String ear, String skin, String eye) {
        if (ear.isEmpty()) {
            return;
        }
        if (ear.contains("i really hate ")) {
            hates = ear.replace("i really hate ", "");
            reply = "ok";
            kokoro.grimoireMemento.simpleSave("diprefer_hates",hates);
            return;
        } // save
        if (ear.contains("i really love ")) {
            loves = ear.replace("i really love ", "");
            reply = "chii";
            kokoro.grimoireMemento.simpleSave("diprefer_loves",loves);
            return;
        } // save
        if (ear.contains(hates)) {
            reply = "chiiangry";
            return;
        }
        if (ear.contains(loves)) {
            reply = "chiihappy";
            return;
        }
    }

    @Override
    public void output(Neuron noiron) {
        if (!reply.isEmpty()) {
            String temp = reply;
            reply = "";
            APSay apSay = new APSay(1, temp);
            ArrayList<AbsAlgPart> algParts = new ArrayList<>();
            algParts.add(apSay);
            Algorithm algorithm = new Algorithm("prefer", "prefreply", algParts);
            noiron.algParts.add(algorithm);
        }
    }
}

clown tongue

_________________
MB over and out emp it up
Back to top Go down
 
DiPrefer convo beef up skill
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: the LivinGrimoire-
Jump to: