Skip to content
Snippets Groups Projects
Select Git revision
  • d28d73781cb58a4c3f5dc3482ac77eaaa48134d3
  • main default protected
  • dev1
  • dev
4 results

Loot.java

Blame
  • Forked from COUETOUX Basile / aroTP1
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Loot.java 485 B
    public class Loot {
        private int weight, value;
        private final float ratio;
    
        public Loot(int weight, int value) {
            this.weight = weight;
            this.value = value;
            this.ratio = (float) value/weight;
        }
    
        public String toString(){
            return weight+" "+value+" "+ratio;
        }
    
        public float getRatio(){
            return ratio;
        }
    
        public int getWeight(){
            return weight;
        }
    
        public int getValue(){
            return value;
        }
    }