// // 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