public WageSlave(String name, int salary, FatCat owner)
        {
            if (name == null || salary == 0 || owner == null)
            {
                throw new InvalidOperationException();
            }

            Name   = name;
            Salary = salary;
            Owner  = owner;
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (obj is WageSlave)
            {
                return(false);
            }

            FatCat boss = null;

            boss = (FatCat)obj;
            return(boss.Name == Name && boss.Owner == Owner && boss.Salary == Salary);
        }
 public WageSlave(String name, int salary, FatCat owner)
 {
     Name   = name;
     Salary = salary;
     Owner  = owner;
 }
 public WageSlave(string name, int salary)
 {
     Name   = name;
     Salary = salary;
     Owner  = null;
 }
Beispiel #5
0
 public FatCat(string name, int salary, FatCat owner)
 {
     Name   = name;
     Salary = salary;
     Owner  = owner;
 }
Beispiel #6
0
 public FatCat(string name, int salary)
 {
     Name   = name;
     Salary = salary;
     Owner  = null;
 }