Convert Figure to abstract base class and implement isValueValid method