Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eventPlanningSystem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sully.khalifa
eventPlanningSystem
Commits
6c67363a
Commit
6c67363a
authored
Jan 19, 2023
by
sully.khalifa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete main.py
parent
eef915e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
173 deletions
+0
-173
main.py
main.py
+0
-173
No files found.
main.py
deleted
100644 → 0
View file @
eef915e0
# Allow users to create multiple events = create a class for <Events>.
#Events attributes : event_name, a name of an organiser, event_description, an array for invited people.
#track whether or not each invitee has RSVP, whether or not if they are bringing a plus one.
# + track whether they have any dietary or other requirements
#create a class for <invitee> ?
#Inviteee attributes : name, gender, plusOne(boolean), dietary / requirements, meals?
#Create a class for <set meal>
#set meal attributes : meal name etc
from
abc
import
ABC
,
abstractmethod
class
SetMeal
(
ABC
):
@
abstractmethod
def
get_drink
(
self
):
pass
@
abstractmethod
def
get_starter
(
self
):
pass
@
abstractmethod
def
get_main
(
self
):
pass
@
abstractmethod
def
get_desert
(
self
):
pass
class
Invitee
(
ABC
):
def
__init__
(
self
,
name
,
age
,
gender
):
self
.
name
=
name
self
.
age
=
age
self
.
gender
=
gender
self
.
plusOne
=
False
self
.
plusOne_name
=
""
self
.
dietary_requirements
=
False
@
abstractmethod
def
set_plus_one
(
self
):
pass
@
abstractmethod
def
set_dietary_requirements
(
self
):
pass
class
Rich_Invitee
(
Invitee
):
def
set_plus_one
(
self
,
name
):
self
.
plusOne
=
True
self
.
plusOne_name
=
name
print
(
"Im Rich"
)
def
set_dietary_requirements
(
self
):
self
.
dietary_requirements
=
True
class
Standard_Invitee
(
Invitee
):
def
set_plus_one
(
self
,
name
):
self
.
plusOne
=
True
self
.
plusOne_name
=
name
def
set_dietary_requirements
(
self
):
self
.
dietary_requirements
=
True
class
StandardSetMeal
(
SetMeal
):
def
get_drink
(
self
):
print
(
"Coke"
)
#Print out a name of the drink here
def
get_starter
(
self
):
print
(
"Chips"
)
#Print out a name of the starter here
def
get_main
(
self
):
print
(
"Cheese Burger"
)
#print out a name of the main here
def
get_desert
(
self
):
print
(
"Pudding"
)
#print out a name of the desert here
class
LuxurySetMeal
(
SetMeal
):
def
get_drink
(
self
):
print
(
"Wine"
)
#Print out a name of the drink here
def
get_starter
(
self
):
print
(
"Caesar Salad"
)
#Print out a name of the starter here
def
get_main
(
self
):
print
(
"Sirloin Steak"
)
#print out a name of the main here
def
get_desert
(
self
):
print
(
"Creme Brulee"
)
#print out a name of the desert here
class
EventFactory
(
ABC
):
def
__init__
(
self
,
title
,
organizer
,
description
):
self
.
title
=
title
self
.
organizer
=
organizer
self
.
description
=
description
self
.
invitees
=
[]
@
abstractmethod
def
get_set_meal
(
self
):
pass
@
abstractmethod
def
get_invitee
(
self
):
pass
@
staticmethod
def
add_invitee
(
self
,
name
):
self
.
invitees
.
append
(
name
)
class
ExpensiveEventFactory
(
EventFactory
):
def
get_set_meal
(
self
)
->
SetMeal
:
return
LuxurySetMeal
()
def
get_invitee
(
self
,
name
,
age
,
gender
)
->
Invitee
:
self
.
invitees
.
append
(
name
)
return
Rich_Invitee
(
name
,
age
,
gender
)
def
add_invitee
(
name
):
EventFactory
.
add_invitee
(
name
)
class
CheapEventFactory
(
EventFactory
):
def
get_set_meal
(
self
)
->
SetMeal
:
return
StandardSetMeal
()
def
get_invitee
(
self
,
name
,
age
,
gender
)
->
Invitee
:
self
.
invitees
.
append
(
name
)
return
Standard_Invitee
(
name
,
age
,
gender
)
def
add_invitee
(
name
):
EventFactory
.
add_invitee
(
name
)
#------------What users can do ----------------------------------------------------
def
createEvent
(
event_type
:
str
,
title
,
organizer
,
description
):
factories
=
{
"Expensive"
:
ExpensiveEventFactory
(
title
,
organizer
,
description
),
"Cheap"
:
CheapEventFactory
(
title
,
organizer
,
description
)
}
event
=
factories
[
event_type
]
return
event
def
select_Meal
(
meal_type
:
str
):
meals
=
{
"Standard"
:
StandardSetMeal
(),
"Luxury"
:
LuxurySetMeal
()
}
set_meal
=
meals
[
meal_type
]
return
set_meal
def
invite
(
person_type
:
str
,
name
,
age
,
gender
):
invitee_type
=
{
"Rich"
:
Rich_Invitee
(
name
,
age
,
gender
),
"Standard"
:
Standard_Invitee
(
name
,
age
,
gender
)
}
invitee
=
invitee_type
[
person_type
]
return
invitee
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment