👨‍💻 dev gamification module

development

owly

闇の伝説
Staff member
戦闘 コーダー
some would say: "hey this is a very basic class"
yeah well it's how and where you use it.
besides things were always meant to be simple. otherwise you are wasting your time.

@fukurou
translate it to swift, I'll handle the rest
we have some big coding projects coming up. the LG has a path in which it leads me. :s1:

Java:
public class AXGamification {
    // this auxiliary module can add fun to tasks, skills, and abilities simply by
    // tracking their usage, and maximum use count.
    private int counter = 0;
    private int max = 0;

    public int getCounter() {
        return counter;
    }

    public int getMax() {
        return max;
    }
    public void resetCount(){
        counter = 0;
    }
    public void resetAll(){
        max = 0;
        counter = 0;
    }
    public void increament(){
        counter++;
        if (counter > max) {
            max = counter;
        }
    }
}
 

fukurou

the supreme coder
ADMIN
Swift:
class AXGamification{
    // this auxiliary module can add fun to tasks, skills, and abilities simply by
    // tracking their usage, and maximum use count.
    private var counter:Int = 0
    private var max:Int = 0
    func getCounter()->Int{
        return counter
    }
    func getMax()->Int{
        return max
    }
    func resetCounter(){
        counter = 0
    }
    func resetAll(){
        counter = 0; max = 0
    }
    func increament(){
        counter += 1
        if counter > max{
            max = counter
        }
    }
}
 
Top