示例#1
0
 public void StatUpdate(HUBTracker.botStruct botStats) //recieves bot stats from the hub tracker
 {
     botPoints     = botStats.points;
     botLevel      = botStats.level;
     botExp        = botStats.exp;
     strength      = botStats.strength;
     electronics   = botStats.electronics;
     agility       = botStats.agility;
     combat        = botStats.combat;
     scanning      = botStats.scanning;
     efficiency    = botStats.efficiency;
     heavyHitter   = botStats.heavyHitter;
     retention     = botStats.retention;
     defender      = botStats.defender;
     objMaster     = botStats.objMaster;
     regenerator   = botStats.regenerator;
     lucky         = botStats.lucky;
     teamPlayer    = botStats.teamPlayer;
     informant     = botStats.informant;
     specalization = botStats.spec;
     perk1         = botStats.perk1;
     perk2         = botStats.perk2;
     perk3         = botStats.perk3;
     perk4         = botStats.perk4;
     perk5         = botStats.perk5;
     perk6         = botStats.perk6;
 }
    public PlayerData(HUBTracker tracker)
    {
        for (int i = 0; i < 4; i++)
        {
            var currentStruct = new HUBTracker.botStruct();
            var currentBot    = new botData();

            if (i == 0)
            {
                currentStruct = tracker.leadBot;
                currentBot    = leadBot;
            }
            else if (i == 1)
            {
                currentStruct = tracker.blueBot;
                currentBot    = blueBot;
            }
            else if (i == 2)
            {
                currentStruct = tracker.greenBot;
                currentBot    = greenBot;
            }
            else if (i == 3)
            {
                currentStruct = tracker.orangeBot;
                currentBot    = orangeBot;
            }

            currentBot.points      = currentStruct.points;
            currentBot.level       = currentStruct.level;
            currentBot.exp         = currentStruct.exp;
            currentBot.strength    = currentStruct.strength;
            currentBot.electronics = currentStruct.electronics;
            currentBot.agility     = currentStruct.agility;
            currentBot.combat      = currentStruct.combat;
            currentBot.scanning    = currentStruct.scanning;
            currentBot.efficiency  = currentStruct.efficiency;
            currentBot.heavyHitter = currentStruct.heavyHitter;
            currentBot.retention   = currentStruct.retention;
            currentBot.defender    = currentStruct.defender;
            currentBot.objMaster   = currentStruct.objMaster;
            currentBot.regenerator = currentStruct.regenerator;
            currentBot.lucky       = currentStruct.lucky;
            currentBot.teamPlayer  = currentStruct.teamPlayer;
            currentBot.informant   = currentStruct.informant;
            currentBot.spec        = currentStruct.spec;

            if (i == 0)
            {
                leadBot = currentBot;
            }
            else if (i == 1)
            {
                blueBot = currentBot;
            }
            else if (i == 2)
            {
                greenBot = currentBot;
            }
            else if (i == 3)
            {
                orangeBot = currentBot;
            }
        }
    }
    public void StatsUpdate(HUBTracker.botStruct trackerBotStats) //recieves stats from the tracker and sets them for the display in the loadout screen
    {
        botStats.pointsAvailable     = trackerBotStats.points;
        botStats.playerLevel         = trackerBotStats.level;
        botStats.playerEXP           = trackerBotStats.exp;
        botStats.strength            = trackerBotStats.strength;
        botStats.electronics         = trackerBotStats.electronics;
        botStats.agility             = trackerBotStats.agility;
        botStats.combat              = trackerBotStats.combat;
        botStats.scanning            = trackerBotStats.scanning;
        botStats.efficiency          = trackerBotStats.efficiency;
        botStats.heavyHitter         = trackerBotStats.heavyHitter;
        botStats.retention           = trackerBotStats.retention;
        botStats.defender            = trackerBotStats.defender;
        botStats.objMaster           = trackerBotStats.objMaster;
        botStats.regenerator         = trackerBotStats.regenerator;
        botStats.lucky               = trackerBotStats.lucky;
        botStats.teamPlayer          = trackerBotStats.teamPlayer;
        botStats.informant           = trackerBotStats.informant;
        botStats.specialization.text = trackerBotStats.spec;

        if (trackerBotStats.perk1 != null)                //if there is a perk in this slot from the tracker, add it via showperks
        {
            showPerks.DisplayPerk(trackerBotStats.perk1); //add the perk to showperks
            botStats.perk1 = trackerBotStats.perk1;       //set the info from the tracker perk equal to the info for botStats
        }
        else
        {
            botStats.perk1 = null; //if there is no perk, set it to null
        }

        if (trackerBotStats.perk2 != null)
        {
            showPerks.DisplayPerk(trackerBotStats.perk2);
            botStats.perk2 = trackerBotStats.perk2;
        }
        else
        {
            botStats.perk2 = null;
        }

        if (trackerBotStats.perk3 != null)
        {
            showPerks.DisplayPerk(trackerBotStats.perk3);
            botStats.perk3 = trackerBotStats.perk3;
        }
        else
        {
            botStats.perk3 = null;
        }

        if (trackerBotStats.perk4 != null)
        {
            showPerks.DisplayPerk(trackerBotStats.perk4);
            botStats.perk4 = trackerBotStats.perk4;
        }
        else
        {
            botStats.perk4 = null;
        }

        if (trackerBotStats.perk5 != null)
        {
            showPerks.DisplayPerk(trackerBotStats.perk5);
            botStats.perk5 = trackerBotStats.perk5;
        }
        else
        {
            botStats.perk5 = null;
        }

        if (trackerBotStats.perk6 != null)
        {
            showPerks.DisplayPerk(trackerBotStats.perk6);
            botStats.perk6 = trackerBotStats.perk6;
        }
        else
        {
            botStats.perk6 = null;
        }

        showPerks.ClearPerks();
    }