// // Demand.h // RefactorDemo // // Created by xishi on 16/10/29. // Copyright ? 2016年 xs. All rights reserved. //
#import <Foundation/Foundation.h>
@class Movie;
- (id)initWithMovie:(Movie *)movie |
// // Demand.m // RefactorDemo // // Created by xishi on 16/10/29. // Copyright ? 2016年 xs. All rights reserved. //
#import "Demand.h"
@implementation Demand |
顾客类:
// // Customer.h // RefactorDemo // // Created by xishi on 16/10/29. // Copyright ? 2016年 xs. All rights reserved. // #import <Foundation/Foundation.h>
@class Demand; |
// // Customer.m // RefactorDemo // // Created by xishi on 16/10/29. // Copyright ? 2016年 xs. All rights reserved. //
#import "Customer.h"
- (void)addDemand:(Demand *)demand {
- (NSString *)statement {
// 根据不同电影定价:
case MovieEnumNewRelease:
case MovieEnumChildrens:
// 根据不同时段定价:
frequentDemandPotnts++;
[result appendFormat:@"\\\\t%@\\\\t%@ 元\\\\n", aDemand.movie.title, @(thisAmount)];
[result appendFormat:@"费用总计 %@ 元\\\\n", @(totalAmount).stringValue];
return result; |
原文转自:http://www.jianshu.com/p/0b4fd636ad2c