Esempio n. 1
0
 def loadFromFiles(self, dirName, pausing=True):
     #get backup location
     backupPath = self.game.backupLocation + "\\" + dirName
     #restore from backup to save game location
     if (copy_tree(backupPath, self.game.saveLocation)):
         print("Loaded backup: \'" + dirName + '\'')
     if (pausing):
         pause()
def addToEvidence(i):
    if (len(possibleEvidence) < 3):
        print()
        if (Evidence[i] in eliminated):
            eliminated.remove(Evidence[i])
        if (Evidence[i] not in possibleEvidence):
            possibleEvidence.append(Evidence[i])
        else:
            print('Already there')
            pause()
Esempio n. 3
0
 def hotkeySaving(self):
     #starts listnening when any keyboard key gets released
     listener = keyboard.Listener(on_release=self.on_release)
     listener.start()
     #on pressing enter it stops the listener
     print(
         'F5 to save, F9 to load, Press Enter while the terminal is focused to stop'
     )
     pause(text='')
     listener.stop()
def updateDescription():
    sMenu.description = '\n'
    possibleGhosts = []
    eliminatedGhosts = []
    neededList = []

    #counts the number of possible evidence in each ghost evidence
    #if all of them are present the ghost is added to possibleGhosts
    for ghost in ghostList:
        evidenceLen = 0
        for e in possibleEvidence:
            if (ghost.evidence_present(e)):
                evidenceLen += 1
        if (evidenceLen == len(possibleEvidence)):
            possibleGhosts.append(ghost)

    #if ghost contains eliminated evidence it is added to eliminatedGhosts
    for evidence in eliminated:
        for ghost in possibleGhosts:
            if (ghost.evidence_present(evidence)
                    and ghost not in eliminatedGhosts):
                #for duplicates
                eliminatedGhosts.append(ghost)

    eliminatedGhostsTable = printableTable()
    eliminatedGhostsTable.style_differentColumns()
    eliminatedGhostsTable.addRow(['Ghost', 'Evidence', 'Desc'])

    possibleGhostsTable = printableTable()
    possibleGhostsTable.setTo(eliminatedGhostsTable)

    eliminatedGhostsTable.middleAllign.append(0)

    #adds ghost to it's proper table
    for ghost in possibleGhosts:
        if ghost in eliminatedGhosts:
            eliminatedGhostsTable.addRow(
                [ghost.name, ghost.Evidence, ghost.desc])
        else:
            possibleGhostsTable.addRow(
                [ghost.name, ghost.Evidence, ghost.desc])

        #adds evidence need to identify
        for evidence in ghost.Evidence:
            #evidence possible			  				#duplicates					 #evidence not eliminated
            if (evidence not in possibleEvidence and evidence not in neededList
                    and evidence not in eliminated):
                neededList.append(evidence)

    if (len(possibleGhosts) > 0):

        #if present print needed evidence table
        if (len(neededList) > 0):
            newTable = printableTable()
            newTable.drawTitleSeperator = False
            newTable.addRow(neededList)
            sMenu.description += '\n' + newTable.getTableTitleFormat(
                'Needed Evidence', alignment='left') + '\n'
            sMenu.description += newTable.getTable()

        #if present print possible evidence
        if (len(possibleEvidence) > 0):
            newTable = printableTable()
            newTable.drawTitleSeperator = False
            newTable.addRow(possibleEvidence)
            sMenu.description += '\n' + newTable.getTableTitleFormat(
                'Current Evidence', alignment='left') + '\n'
            sMenu.description += newTable.getTable()

        #if present print current eliminated evidence table
        if (len(eliminated) > 0 and len(possibleEvidence) != 3):
            newTable = printableTable()
            newTable.drawTitleSeperator = False
            newTable.addRow(eliminated)
            sMenu.description += '\n' + newTable.getTableTitleFormat(
                'Eliminated Evidence', alignment='left') + '\n'
            sMenu.description += newTable.getTable()

        #if present print current eliminated ghosts table
        if (len(eliminatedGhosts) > 0):
            sMenu.description += '\n' + newTable.getTableTitleFormat(
                'Eliminated Ghosts', alignment='left') + '\n'
            sMenu.description += eliminatedGhostsTable.getTable()

        #print possible ghosts table
        titleForPossibleTable = 'Possible Ghosts'
        #if there is only one change the title from possible to confirmed
        if (len(possibleGhosts) == 1):
            titleForPossibleTable = 'Confirmed Ghost'
        sMenu.description += '\n' + newTable.getTableTitleFormat(
            titleForPossibleTable, alignment='left') + '\n'
        sMenu.description += possibleGhostsTable.getTable()

    #no ghosts possible remove last evidence
    else:
        possibleEvidence.pop()
        print('Last added evidence not possible')
        pause()
Esempio n. 5
0
 def save(self):
     #call backup with True so user can make a custom note
     self.backup(True)
     pause()
Esempio n. 6
0
def option_1():
    print('You have selected the First option')
    pause()
Esempio n. 7
0
def option_customKey():
    print('You have selected the option with the letter e')
    pause()
Esempio n. 8
0
def option_args(args):
    print('You have selected the second option')
    print('arg1 is \'' + args[0] + '\' , arg2 is \'' + args[1] + '\'')
    pause()
Esempio n. 9
0
def option_2():
    print('You have selected the Second option')
    pause()
Esempio n. 10
0
	def openAuto( self ):
		#TODO
		print('auto not available yet')
		pause()
		pass