Skip to content
Open
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 @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
0D55A5DE1E9CD11E00CD1B41 /* IronMan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D55A5DD1E9CD11E00CD1B41 /* IronMan.swift */; };
1716AF9F1CCE8A7600264EBE /* Obama.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1716AF9E1CCE8A7600264EBE /* Obama.swift */; };
3284A1361CD3FD4500A5DD4F /* Minion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3284A1351CD3FD4500A5DD4F /* Minion.swift */; };
3284A13C1CD4010200A5DD4F /* Barney.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3284A13B1CD4010200A5DD4F /* Barney.swift */; };
Expand Down Expand Up @@ -37,6 +38,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0D55A5DD1E9CD11E00CD1B41 /* IronMan.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IronMan.swift; sourceTree = "<group>"; };
1716AF9E1CCE8A7600264EBE /* Obama.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Obama.swift; sourceTree = "<group>"; };
3284A1351CD3FD4500A5DD4F /* Minion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Minion.swift; sourceTree = "<group>"; };
3284A13B1CD4010200A5DD4F /* Barney.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Barney.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -165,6 +167,7 @@
isa = PBXGroup;
children = (
87468FD61CCD3B3500DB4A03 /* Yoda.swift */,
0D55A5DD1E9CD11E00CD1B41 /* IronMan.swift */,
DC161D071CD60CE7001ADBC4 /* Seneca.swift */,
A016F8D31CCE76A80039184B /* Nathan.swift */,
1716AF9E1CCE8A7600264EBE /* Obama.swift */,
Expand Down Expand Up @@ -276,6 +279,7 @@
3284A13C1CD4010200A5DD4F /* Barney.swift in Sources */,
9DCCE6CD1CD3457F0074771D /* Sheldon.swift in Sources */,
87DC34E61CEA18A000AC0EE6 /* Teenager.swift in Sources */,
0D55A5DE1E9CD11E00CD1B41 /* IronMan.swift in Sources */,
3284A1361CD3FD4500A5DD4F /* Minion.swift in Sources */,
79A8A7631CD0072100C7A040 /* Sherlock.swift in Sources */,
879EC5451AF29DC200F36F1C /* ViewController.swift in Sources */,
Expand Down
21 changes: 21 additions & 0 deletions chatter/Images.xcassets/Iron Man.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Iron Man.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions chatter/IronMan.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//
// IronMan.swift
// chatter
//
// Created by Elvira Beisel on 11.04.17.
// Copyright © 2017 Universität Heidelberg. All rights reserved.
//

import Foundation
import UIKit

class IronMan : Chatter{

required init() {
super.init(image: UIImage(named: "Iron Man"))
}

override func nextMessage() -> Message {
return [
Message(content: "How'd you solve the icing problem?", type: .questionWhy),
Message(content: "It's your birthday?", type: .questionBool),
Message(content: "What is the point of owning a race car if you can't drive it?", type: .questionBool),
Message(content: "What are you trying to get rid of me for? You got plans?", type: .questionBool),
Message(content: "Give me a scotch. I'm starving", type: .statement),


].randomElement()
}

override func responseForMessage(_ message: Message) -> Message {
switch message.type {
case .statement:
return [
Message(content: "I don't like it when you have plans.", type: .statement),
Message(content: "Give me a scotch. I'm starving.", type: .statement),
Message(content: "Iron Man. That's kind of catchy. It's got a nice ring to it.", type: .statement),
Message(content: "Yeah...okay.", type: .statement),
Message(content: "I'm a huge fan of the way you lose control and turn into an enourmous green rage monster.", type: .statement),
Message(content: "Yeah? And?", type: .questionWhy),
Message(content: "👍", type: .statement)
].randomElement()
case .questionBool:
return [
Message(content: "Let's face it, this is not the worst thing you've caught me doing.", type: .statement),
Message(content: "I knew that.", type: .statement),
Message(content: "I already told you, I don't want to join your super secret boy band.", type: .statement),
Message(content: "You know, it's times like these when I realize what a superhero I am.", type: .statement),
Message(content: "Might wanna look into it!", type: .statement),
Message(content: "Yeah, I can fly!", type: .statement),
Message(content: "It's totally cool if you take a picture with me. Don't put this on MySpace. Please, no gang signs. Just kidding, you can put it up", type: .statement)
].randomElement()
case .questionWhy:
return [
Message(content: "I am Iron Man.", type: .statement),
Message(content: "Why not?", type: .statement),
Message(content: "Who knows?!", type: .statement),
Message(content: "Look, stop telling me. Just leave it on the screen.", type: .statement),
Message(content: "Look at me, I'm flying!", type: .statement),
].randomElement()

case .joke:
return [
Message(content: "Yeah well vacation's over.", type: .statement),
Message(content: "Hihihi", type: .statement),
Message(content: "Good one 😉", type: .statement),
Message(content: "😀😀", type: .statement)
].randomElement()
}
}

}