-
-
Save onli/f3d295667cc5288b720eb01f3c1c5754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PCData | |
class Benchmark | |
# get the current online rating from the internet | |
def queryRating(hardware) | |
return getCpuRating(hardware.generic) if hardware.class.to_s == "Cpu" | |
return getGpuRating(hardware.generic) if hardware.class.to_s == "Gpu" | |
end | |
# get the current online rating and store it in the database | |
def updateRating(hardware) | |
rating = self.queryRating(hardware) | |
Database.instance.setRating(hardware, self.class.to_s, rating.to_s.tr(",", ".").to_f) if rating.to_f.respond_to?("zero?") | |
end | |
# returns the rating stored in the database and the current max rating | |
def getRating(hardware) | |
Database.instance.getRating(hardware.generic, self.class.to_s) | |
end | |
# returns the type of the higest rated hardware item | |
def highestType(hardware) | |
Database.instance.getHighestType(self.class.to_s, hardware) | |
end | |
# return all cpus benched in this benchmark | |
def getCpus() | |
return Database.instance.getBenchmarkCpus(self.class.to_s) | |
end | |
# return all cpus benched in this benchmark | |
def getGpus() | |
return Database.instance.getBenchmarkGpus(self.class.to_s) | |
end | |
def active | |
return true | |
end | |
def focus | |
return :games | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment