//
//  MPMathRules.m
//  MathKit
//
//  Created by Kim Wittenburg on 14.09.14.
//  Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//

#import "MPMathRules.h"


NSString *MPMathRulesIsUsingDegreesKey = @"MPMathRulesIsUsingDegreesKey";



@implementation MPMathRules

static MPMathRules *sharedRules;


+ (MPMathRules *)sharedRules
{
    if (!sharedRules) {
        sharedRules = [[MPMathRules alloc] init];
    }
    return sharedRules;
}


- (instancetype)init
{
    if (sharedRules) {
        return sharedRules;
    }
    self = [super init];
    if (self) {
    }
    return self;
}


- (BOOL)isUsingDegrees
{
    return [[NSUserDefaults standardUserDefaults] boolForKey:MPMathRulesIsUsingDegreesKey];
}


- (void)setIsUsingDegrees:(BOOL)isUsingDegrees
{
    [[NSUserDefaults standardUserDefaults] setBool:isUsingDegrees
                                                forKey:MPMathRulesIsUsingDegreesKey];
}

@end
