public void AddItem( Object obj ) { // For now we're not giving credit for food and trash items. if( obj.ItemType == ObjTemplate.ObjectType.food || obj.ItemType == ObjTemplate.ObjectType.trash ) { return; } ++_quantity; int cost = obj.Cost; _totalCost += cost; if( cost > _maxCost ) { _maxCost = cost; } }
// Constructors let us take one of many types and automatically set // the type to the correct value. public Target( Object ob ) { _obj = ob; _type = TargetType.object_target; }