Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions chatter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -24,6 +25,7 @@

/* Begin PBXFileReference section */
1716AF9E1CCE8A7600264EBE /* Obama.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Obama.swift; sourceTree = "<group>"; };
8393795A1CD11B9D00E786E8 /* Zocker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Zocker.swift; sourceTree = "<group>"; };
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; };
Expand Down Expand Up @@ -139,6 +141,7 @@
87468FD61CCD3B3500DB4A03 /* Yoda.swift */,
A016F8D31CCE76A80039184B /* Nathan.swift */,
1716AF9E1CCE8A7600264EBE /* Obama.swift */,
8393795A1CD11B9D00E786E8 /* Zocker.swift */,
);
name = Chatters;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down
2 changes: 2 additions & 0 deletions chatter/Chatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion chatter/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="KlN-FF-yTo">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15F24b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="KlN-FF-yTo">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
Expand Down
75 changes: 75 additions & 0 deletions chatter/Zocker.swift
Original file line number Diff line number Diff line change
@@ -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)
}

}
}