diff --git a/chatter.xcodeproj/project.pbxproj b/chatter.xcodeproj/project.pbxproj index b41ad17..d95335f 100644 --- a/chatter.xcodeproj/project.pbxproj +++ b/chatter.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1716AF9F1CCE8A7600264EBE /* Obama.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1716AF9E1CCE8A7600264EBE /* Obama.swift */; }; + 8393795B1CD11B9D00E786E8 /* Zocker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8393795A1CD11B9D00E786E8 /* Zocker.swift */; }; 8739C1BD191C1203009C7B3B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8739C1BC191C1203009C7B3B /* Foundation.framework */; }; 8739C1BF191C1203009C7B3B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8739C1BE191C1203009C7B3B /* CoreGraphics.framework */; }; 8739C1C1191C1203009C7B3B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8739C1C0191C1203009C7B3B /* UIKit.framework */; }; @@ -24,6 +25,7 @@ /* Begin PBXFileReference section */ 1716AF9E1CCE8A7600264EBE /* Obama.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Obama.swift; sourceTree = ""; }; + 8393795A1CD11B9D00E786E8 /* Zocker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Zocker.swift; sourceTree = ""; }; 8739C1B9191C1203009C7B3B /* chatter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = chatter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8739C1BC191C1203009C7B3B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 8739C1BE191C1203009C7B3B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; @@ -139,6 +141,7 @@ 87468FD61CCD3B3500DB4A03 /* Yoda.swift */, A016F8D31CCE76A80039184B /* Nathan.swift */, 1716AF9E1CCE8A7600264EBE /* Obama.swift */, + 8393795A1CD11B9D00E786E8 /* Zocker.swift */, ); name = Chatters; sourceTree = ""; @@ -211,6 +214,7 @@ buildActionMask = 2147483647; files = ( 87468FDA1CCD3B3500DB4A03 /* Yoda.swift in Sources */, + 8393795B1CD11B9D00E786E8 /* Zocker.swift in Sources */, 879EC5111AF2952E00F36F1C /* AppDelegate.swift in Sources */, 87468FD71CCD3B3500DB4A03 /* Chatter.swift in Sources */, A016F8D41CCE76A80039184B /* Nathan.swift in Sources */, diff --git a/chatter/Chatter.swift b/chatter/Chatter.swift index ab9e85d..f7f93a8 100644 --- a/chatter/Chatter.swift +++ b/chatter/Chatter.swift @@ -114,6 +114,8 @@ class Chatter { Message(content: "Good one 😉", type: .Statement), Message(content: "😀😀", type: .Statement) ].randomElement() + default: + return Message(content: "Why not", type: .Statement) } } diff --git a/chatter/Main.storyboard b/chatter/Main.storyboard index 0338c09..a377481 100644 --- a/chatter/Main.storyboard +++ b/chatter/Main.storyboard @@ -1,5 +1,5 @@ - + diff --git a/chatter/Zocker.swift b/chatter/Zocker.swift new file mode 100644 index 0000000..114929c --- /dev/null +++ b/chatter/Zocker.swift @@ -0,0 +1,75 @@ +// +// Zocker.swift +// chatter +// +// Created by Christoph Blattgerste on 27.04.16. +// Copyright © 2016 Universität Heidelberg. All rights reserved. +// + +import Foundation +import UIKit + +class Zocker: Chatter { + + required init() { + super.init(image: UIImage(named: "homer")) + } + + override func nextMessage() -> Message { + return [ + Message(content: "Why don't they kick him?! He's such a cheater!", type: .QuestionBool), + Message(content: "Do you use the internet? I loose all the time", type: .QuestionBool), + Message(content: "Real gamer do not clean up, they defragment", type: .Joke), + Message(content: "Yeah, I got it!!", type: .Statement), + Message(content: "...", type: .Statement), + Message(content: "Look, this is it!", type: .Statement), + Message(content: "I won't play this $@!/ing game anymore!", type: .Statement), + Message(content: "Get Nintendo or change the system...", type: .Joke), + Message(content: "I'll jump out of this windows!!", type: .Statement) + + ].randomElement() + + } + + var angry = 0 + + override func responseForMessage(message: Message) -> Message { + switch message.type { + case .QuestionWhy: +// zählt die WhyFragen, Antworten werden immer genervter + switch angry { + case 0: + angry += 1 + return Message(content: "That's no big deal. What a bit.", type: .Statement) + case 1: + angry += 1 + return Message(content: "What's your idea?", type: .QuestionWhy) + case 2: + angry += 1 + return Message(content: "Are you serious?", type: .QuestionBool) + case 3: + angry += 1 + return Message(content: "This does not interest me at all", type: .Statement) + case 4: + angry += 1 + return Message(content: "Shut up!! I have to concentrate!", type: .Statement) + default: + angry = 0 + return Message(content: "Talk to my Hand!!", type: .Statement) + } + case .QuestionBool: + return [ + Message(content: "No", type: .Statement), + Message(content: "Do you?", type: .QuestionBool), + Message(content: "What do you mean?", type: .QuestionBool) + ].randomElement() + case .Statement: + return Message(content: "...", type: .Statement) + case .Joke: + return Message(content: "I already knew this one..", type: .Statement) + default: + return Message(content: "I'm hungry..", type: .Statement) + } + + } +} \ No newline at end of file