var/list/rankholder1 = list("Player"="Someone","Level"=2000)
var/list/rankholder2 = list("Player"="Someone","Level"=2000)
var/list/rankholder3 = list("Player"="Someone","Level"=2000)
mob
verb
View_Rank()
var/p
var/savefile/Rankers = new("Rankers.sav")
Rankers["rankholder1"] >> rankholder1
Rankers["rankholder2"] >> rankholder2
Rankers["rankholder3"] >> rankholder3
for(var/i=1,i<=rankholder1.len,i++)
p = rankholder1[i]
src<< "<b>One: [p] = [rankholder1[p]]<br><br></b>"
for(var/i=1,i<=rankholder2.len,i++)
p = rankholder2[i]
src<< "<b>One: [p] = [rankholder2[p]]<br><br></b>"
for(var/i=1,i<=rankholder3.len,i++)
p = rankholder3[i]
src<< "<b>One: [p] = [rankholder3[p]]<br><br></b>"
Test_Rank()
var/savefile/Rankers = new("Rankers.sav")
if(rankholder1.len)
if(src.level>rankholder1["Level"])
rankholder1["Player"] = "[src]"
rankholder1["Level"] = src.level
Rankers["rankholder1"] << rankholder1
src.status = "Captain"
src.squad = "One"
return
if(rankholder2.len)
if(src.level>rankholder2["Level"])
rankholder2["Player"] = "[src]"
rankholder2["Level"] = src.level
Rankers["rankholder2"] << rankholder2
src.status = "Captain"
src.squad = "Two"
return
if(rankholder3.len)
if(src.level>rankholder3["Level"])
rankholder3["Player"] = "[src]"
rankholder3["Level"] = src.level
Rankers["rankholder3"] << rankholder3
src.status = "Captain"
src.squad = "Three"
return
Problem description:
Well, I'm attempting to implement a Ranking system that's completely automatic, and I have the feeling I'm going at this horribly wrong. What I'm trying to do is basically this, but 46 times (its a Bleach game taking account 13 Captains, 13 Lieutenants and 20 Other ranks) which ends up being 46 some odd vars, another 46 lines for just loading up each var, Basically it seems like its being "Over coded". Well basically what I'm asking is if there is a better way to do this.