예제 #1
0
from Ui import Console
from Business import ServiceRoom, ServiceReservation
from Repository import FileRepo
from Validators import ValidateReservation
from Domain import Room, Reservation

validateReservation = ValidateReservation()

repoRooms = FileRepo('rooms', Room.read_room, Room.write_room)
repoReservations = FileRepo('reservations', Reservation.read_reservation,
                            Reservation.write_reservation)

validateReservation = ValidateReservation()

serviceReservation = ServiceReservation(repoReservations, repoRooms,
                                        validateReservation)
serviceRoom = ServiceRoom(repoRooms)

console = Console(serviceReservation, serviceRoom)

console.run()
예제 #2
0
from Repository import FileRepo
from Validators import ValidateSentence
from Controller import SentenceController
from Ui import Console

repoSentences = FileRepo('sentences')

validateSentence = ValidateSentence()

sentenceController = SentenceController(repoSentences, validateSentence)

console = Console(sentenceController)

console.run()
예제 #3
0
from Ui import Console
from Controller import Controller
from Repository import Repo
from Validators import Validate


repoGame = Repo()
validate = Validate()


controller = Controller(repoGame, validate)

console = Console(controller)

console.run()
예제 #4
0
from Repository import RepoShips
from Validators import ValidateShip, ValidatePoint
from ShipsController import ShipController
from Domain import Ship, Point
from Ui import Console

repoShips = RepoShips()
repoComputer = RepoShips()
#repoShips.add(Ship(Point('A', '1'), Point('A','2'), Point('A', '3')))
#repoShips.add(Ship(Point('D', '1'), Point('D','2'), Point('D', '3')))

validateShip = ValidateShip()
validatePoint = ValidatePoint()

shipController = ShipController(repoShips, validateShip, validatePoint)
computerController = ShipController(repoComputer, validateShip, validatePoint)

console = Console(shipController, computerController)

console.run()
예제 #5
0
from Domain import Student, Grades
from Repository import StudentRepo, GradeRepo
from Controller import StudentController, GradeController
from Ui import Console

# Create the repositories
studentRepo = StudentRepo('students', Student.write_student,
                          Student.read_student)
gradeRepo = GradeRepo('grades', Grades.write_grades, Grades.read_grades)

# Create the controllers
studenController = StudentController(studentRepo)
gradeController = GradeController(gradeRepo, studentRepo)

# Create the console
console = Console(studenController, gradeController)

console.run()
예제 #6
0
from Ui import Console
from Controller import GameControler
from Repository import Repo
from Validate import Validate

repoGame = Repo()
validate = Validate()

gameController = GameControler(repoGame, validate)

console = Console(gameController)

console.run()
예제 #7
0
from Ui import Console
from Controller import PlayerController, ComputerController
from Validators import Validate
from Repository import Repo

validate = Validate()
repoPoints = Repo()
repoCPoints = Repo()

playerController = PlayerController(validate, repoPoints)
computerController = ComputerController(validate, repoCPoints)

console = Console(playerController, computerController)

console.run()