Esempio n. 1
0
    public static void Initialize(MenuFormController menuFormPrefab)
    {
        //AccountInfo = DataModel.AccountInfo;

        OtherAccount friend = new OtherAccount()
        {
            Nickname  = "Boss",
            Level     = 2,
            Id        = 0,
            Losses    = 55,
            Victories = 1,
            Clan      = new OtherClan()
            {
                Id = 3, Name = "TopClan"
            }
        };
        OtherAccount friend2 = new OtherAccount()
        {
            Nickname  = "Boss2",
            Level     = 2,
            Id        = 2,
            Losses    = 55,
            Victories = 1,
            Clan      = new OtherClan()
            {
                Id = 3, Name = "TopClan2s"
            }
        };
        OwnClan clan = new OwnClan()
        {
            Leader = friend, Id = 0, DateOfCreation = DateTime.Now, Name = "TopClan", SeasonalPoints = 20000, Participants = new HashSet <OtherAccount>()
        };

        clan.Participants.Add(friend);
        clan.Participants.Add(friend2);
        OwnAccount ownAccount = new OwnAccount
        {
            Id               = 1,
            Nickname         = "Leha.Monstr",
            Level            = 5,
            Money            = 5555,
            Losses           = 1,
            Victories        = 55,
            Friends          = new HashSet <OtherAccount>(),
            Clan             = clan,
            AccountStatus    = GameCore.Model.AccountStatus.Priority,
            ClanPoints       = 9999,
            LevelPoints      = 10,
            SeasonalPoints   = 50,
            DateOfMembership = DateTime.Now
        };

        AccountInfo = ownAccount;

        ownAccount.Friends.Add(friend);
        ownAccount.Friends.Add(friend2);
        _menuForm = GameObject.Instantiate(menuFormPrefab);
        SetNewMenuContent(MenuFormContentType.Start);
    }
Esempio n. 2
0
 public static void Initialize(OwnAccount ownAccount)
 {
     AccountInfo = ownAccount;
     foreach (OtherAccount item in ownAccount.Friends)
     {
         _otherAccounts.Add(item.Id, item);
     }
 }
Esempio n. 3
0
 public static void LogInResponse(OwnAccount account)
 {
     if (account == null)
     {
         MessageProcessingManager.InvokeMessageBox(MessageCode.LogInError);
     }
     DataModel.Initialize(account);
     SceneController.ChangeScene(SceneCode.Menu);
 }
Esempio n. 4
0
    public static void SignUpResponse(byte result, OwnAccount account)
    {
        switch ((SignUpResultCode)result)
        {
        case SignUpResultCode.SignUpEmailExists:
        {
            MessageProcessingManager.InvokeMessageBox("Specified email exists.");
            break;
        }

        case SignUpResultCode.SignUpNicknameExists:
        {
            MessageProcessingManager.InvokeMessageBox("Specified nickname exists.");
            break;
        }

        case SignUpResultCode.SignUpSuccessfully:
        {
            DataModel.Initialize(account);
            SceneController.ChangeScene(SceneCode.Menu);
            break;
        }
        }
    }
Esempio n. 5
0
 public static void Reset()
 {
     AccountInfo = null;
     _otherAccounts.Clear();
     _otherAccountRequestes.Clear();
 }