예제 #1
0
    // Start is called before the first frame update
    new void Start()
    {
        btnFiefDetails.onClick.AddListener(MoveToSceneFiefDetails);
        btnMap.onClick.AddListener(() => { GoToScene(SceneName.Map); });

        DisplayCharName();

        ddOwnedCharacters.ClearOptions();
        ProtoGenericArray <ProtoCharacterOverview> ownedCharList = GetNPCList("Family Employ", tclient);

        foreach (ProtoCharacterOverview character in ownedCharList.fields)
        {
            ddOwnedCharacters.options.Add(new Dropdown.OptionData(character.charID));
        }


        //currentFief = GetFiefDetails(protoClient.activeChar.location, tclient);
        //int index = ddOwnedCharacters.options.FindIndex((i) => { return i.text.Equals(activeCharName); });
        //ddOwnedCharacters.value = index;
        //DisplayFiefDetails();

        ddOwnedCharacters.onValueChanged.AddListener(ChangeCharacter);

        //btnTest.onClick.AddListener(TestFunc);

        //ddOwnedFiefs.ClearOptions();
        //ddOwnedFiefs.AddOptions(new List<string>{"test","that","this","works"});

        //ProtoGenericArray<ProtoFief> ownedFiefsLst = ViewMyFiefs(tclient);
        //foreach(ProtoFief fief in ownedFiefsLst.fields) {
        //    ddOwnedFiefs.options.Add(new Dropdown.OptionData(fief.fiefID));
        //}
    }
예제 #2
0
 public void DisplayJournalEntries(ProtoGenericArray <ProtoJournalEntry> journalEntriesProtoBuf)
 {
     Console.WriteLine("-----------------------------");
     Console.WriteLine("Journal Entries");
     Console.WriteLine("-----------------------------");
     if (journalEntriesProtoBuf.fields != null)
     {
         foreach (var journal in journalEntriesProtoBuf.fields)
         {
             Console.WriteLine("-----------------------------");
             Console.WriteLine("Journal Entry ID: " + journal.jEntryID);
             Console.WriteLine("Journal Event Year: " + journal.year);
             Console.WriteLine("Journal Event Location: " + journal.location);
             Console.WriteLine("Journal Personae: ");
             foreach (var pers in journal.personae)
             {
                 Console.WriteLine("    " + pers.charName);
             }
             Console.WriteLine("Entry type: " + journal.type);
             Console.WriteLine("-----------------------------");
         }
     }
     else
     {
         Console.WriteLine("No Journal Entries found.");
     }
 }
예제 #3
0
    public static ProtoMessage AutoAdjustExpenditure(string fiefID, TextTestClient client)
    {
        ProtoGenericArray <double> request = new ProtoGenericArray <double> {
            Message    = fiefID,
            ActionType = Actions.AdjustExpenditure
        };

        client.net.Send(request);
        return(GetActionReply(Actions.AdjustExpenditure, client));
    }
예제 #4
0
    public static ProtoMessage AdjustExpenditure(string fiefID, double[] adjustedValues, TextTestClient client)
    {
        ProtoGenericArray <double> request = new ProtoGenericArray <double> {
            ActionType = Actions.AdjustExpenditure,
            Message    = fiefID,
            fields     = adjustedValues
        };

        client.net.Send(request);
        return(GetActionReply(Actions.AdjustExpenditure, client));
    }
예제 #5
0
    private void BtnViewEntourage()
    {
        // chars to view
        ProtoGenericArray <ProtoCharacterOverview> entourageList = GetNPCList("Entourage", tclient);

        //foreach(ProtoCharacterOverview character in possibleBailiffs.fields) {

        //}
        characterList           = entourageList;
        viewingListSelectAction = "Entourage";

        GoToScene(SceneName.ViewingList);
    }
예제 #6
0
    private void BtnViewPossibleBailiffs()
    {
        // chars to view, male 14+
        ProtoGenericArray <ProtoCharacterOverview> possibleBailiffs = GetNPCList("Family Employ", tclient);

        //foreach(ProtoCharacterOverview character in possibleBailiffs.fields) {

        //}
        characterList           = possibleBailiffs;
        viewingListSelectAction = "AssignBailiff";

        GoToScene(SceneName.ViewingList);
    }
예제 #7
0
 public void DisplaySiegeResult(ProtoGenericArray <ProtoSiegeOverview> siegeResultProtobuf)
 {
     Console.WriteLine("-----------------------------");
     Console.WriteLine("Sieges Overview");
     Console.WriteLine("-----------------------------");
     if (siegeResultProtobuf.fields != null)
     {
         foreach (var siege in siegeResultProtobuf.fields)
         {
             Console.Write(siege.siegeID + ": " + siege.besiegingPlayer
                           + " vs. " + siege.defendingPlayer + " in " + siege.besiegedFief + "\n");
             Console.WriteLine("-----------------------------");
         }
     }
 }
예제 #8
0
        public void DisplayPlayers(ProtoGenericArray <ProtoPlayer> playersProtoBuf)
        {
            Console.WriteLine("-----------------------------");
            Console.WriteLine("Players on Server Report");
            Console.WriteLine("-----------------------------");
            var counter = 0;

            foreach (var player in playersProtoBuf.fields)
            {
                counter++;
                Console.WriteLine("Player " + counter);
                Console.WriteLine("Player ID: " + player.playerID);
                Console.WriteLine("Player Name: " + player.pcName);
                Console.WriteLine("-----------------------------");
            }
        }
예제 #9
0
        public string DisplayCheck(ProtoGenericArray <ProtoFief> fiefsProtoBuf)
        {
            Console.WriteLine("-----------------------------");
            Console.WriteLine("Fiefs Owned Report");
            Console.WriteLine("-----------------------------");
            Console.Write("Fiefs owned by ");
            bool   written = false;
            string charID  = "";

            foreach (var fief in fiefsProtoBuf.fields)
            {
                if (!written)
                {
                    Console.Write(fief.owner + ": \n");
                    written = true;
                    charID  = fief.ownerID;
                }
                Console.WriteLine(fief.fiefID);
            }
            Console.WriteLine("-----------------------------");
            return(charID);
        }
예제 #10
0
        public void DisplayArmyStatus(ProtoGenericArray <ProtoArmyOverview> armiesProtoBuf)
        {
            Console.WriteLine("-----------------------------");
            Console.WriteLine("Army Report");
            Console.WriteLine("-----------------------------");
            var counter = 0;

            if (armiesProtoBuf.fields != null)
            {
                foreach (var army in armiesProtoBuf.fields)
                {
                    counter++;
                    Console.WriteLine("Army " + counter);
                    Console.WriteLine("Army ID: " + army.armyID);
                    Console.WriteLine("Owner: " + army.ownerName);
                    Console.WriteLine("Size: " + army.armySize);
                    Console.WriteLine("Troops: ");
                    for (int i = 0; i < army.troops.Length; i++)
                    {
                        switch (i)
                        {
                        case 0:
                        {
                            Console.WriteLine("  Knights: " + army.troops[i]);
                            break;
                        }

                        case 1:
                        {
                            Console.WriteLine("  Men at Arms: " + army.troops[i]);
                            break;
                        }

                        case 2:
                        {
                            Console.WriteLine("  Light Cavalry: " + army.troops[i]);
                            break;
                        }

                        case 3:
                        {
                            Console.WriteLine("  Longbowmen: " + army.troops[i]);
                            break;
                        }

                        case 4:
                        {
                            Console.WriteLine("  Crossbowmen: " + army.troops[4]);
                            break;
                        }

                        case 5:
                        {
                            Console.WriteLine("  Footmen: " + army.troops[5]);
                            break;
                        }

                        case 6:
                        {
                            Console.WriteLine("  Rabble: " + army.troops[6]);
                            break;
                        }

                        default:
                            break;
                        }
                    }
                    Console.WriteLine("Location : " + army.locationID);
                    Console.WriteLine("Auto Support when ally attacks in same Fief: " + army.autoSupportAttack);
                    Console.WriteLine("Auto Support when ally defends in same Fief: " + army.autoSupportDefence);
                    Console.WriteLine("Auto Pillage to maintain army: " + army.autoPillage);
                    Console.WriteLine("Army loyalty: " + army.loyalty * 10);
                    Console.WriteLine("Army morale: " + army.morale * 100);
                    Console.WriteLine("-----------------------------");
                }
            }
        }