👨‍💻 dev new AXs

development

fukurou

the supreme coder
ADMIN
Java:
import java.util.Hashtable;

public class AXTimeContextResponder {
    // output reply based on the part of day as context
    private PlayGround pl = new PlayGround();
    public Responder morning = new Responder();
    public Responder afternoon = new Responder();
    public Responder evening = new Responder();
    public Responder night = new Responder();
    protected Hashtable<String, Responder> responders = new Hashtable<>();

    public AXTimeContextResponder() {
        responders.put("morning", morning);
        responders.put("afternoon", afternoon);
        responders.put("evening", evening);
        responders.put("night", night);
    }

    public String respond(){
        return responders.get(pl.partOfDay()).getAResponse();
    }
}
 

fukurou

the supreme coder
ADMIN
Java:
import LivinGrimoire.LGFIFO;

public class UniqueItemsPriorityQue extends LGFIFO<String>{
    // a priority queue without repeating elements
    @Override
    public void add(String item) {
        if(!super.contains(item)){
        super.add(item);}
    }
    public String peak() {
        String temp = super.peak();
        if (temp == null){
            return "";
        }
        return temp;
    }
}
 
Top