Beispiel #1
0
    private static string LobbyIdJson(LobbyType lobbyType, string lobbyId)
    {
        var lobbyIdJson = new LobbyId()
        {
            lobbyId = lobbyId
        };
        var jsonString = JsonConvert.SerializeObject(lobbyIdJson);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(lobbyType.ToString(), jsonString)));
    }
Beispiel #2
0
    private static string CreateAuthJson(AuthType authType, string username, string password)
    {
        var authAttributes = new AuthAttributes()
        {
            username = username,
            password = password
        };
        var jsonString = JsonConvert.SerializeObject(authAttributes);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(authType.ToString(), jsonString)));
    }
Beispiel #3
0
    private static string DisconnectFromLobbyJson(string lobbyId, string playerId)
    {
        var lobbyIdJson = new PlayerIdLobby()
        {
            lobbyId  = lobbyId,
            playerId = playerId,
        };
        var jsonString = JsonConvert.SerializeObject(lobbyIdJson);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(LobbyType.disconnect.ToString(), jsonString)));
    }
    public static string CreateCardJson(string gameId, string cardId, string command)
    {
        var authAttributes = new CardActionAttributes()
        {
            gameId = gameId,
            cardId = cardId
        };
        var jsonString = JsonConvert.SerializeObject(authAttributes);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(command, jsonString)));
    }
Beispiel #5
0
    private static string ConnectToLobbyJson(string lobbyId, string playerName, string sessionId)
    {
        var lobbyIdJson = new PlayerConnectLobby()
        {
            lobbyId     = lobbyId,
            playerName  = playerName,
            accessToken = sessionId
        };
        var jsonString = JsonConvert.SerializeObject(lobbyIdJson);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(LobbyType.connect.ToString(), jsonString)));
    }
Beispiel #6
0
    private static string UpdateLobbyInfoJson(string lobbyId, string playerId, string state)
    {
        var lobbyIdJson = new UpdateLobby()
        {
            lobbyId  = lobbyId,
            playerId = playerId,
            state    = state
        };
        var jsonString = JsonConvert.SerializeObject(lobbyIdJson);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(LobbyType.update.ToString(), jsonString)));
    }
Beispiel #7
0
    private static string LobbyInfoJson(string ownerName, string lobbyName, int maxPlayers,
                                        int moveTime, string accessToken)
    {
        var lobbyInfoJson = new LobbyInfo()
        {
            ownerName   = ownerName,
            lobbyName   = lobbyName,
            maxPlayers  = maxPlayers.ToString(),
            moveTime    = moveTime.ToString(),
            accessToken = accessToken
        };
        var jsonString = JsonConvert.SerializeObject(lobbyInfoJson);

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(LobbyType.create.ToString(), jsonString)));
    }
    void ShowNextImage()
    {
        progressPresenter.currentCount = currentIndex;
        if (currentIndex < classList.Count)
        {
            currentClass = classList[currentIndex];
            imageCreator.LoadImage(currentClass);

            currentIndex++;
        }
        else
        {
            if (!finishedFlag)
            {
                jsonCreator.CreateJson(cm_Data);
                progressPresenter.ShowFinishMessage();
                finishedFlag = true;
            }
        }
    }
        public ActionResult StockCatalogues()
        {
            #region NoInternetConnection
            StockPortfolio largeCapPortfolio            = new StockPortfolio("Large Cap");
            StockPortfolio avanzaLargeCapStockPortfolio = AvanzaParsers.ParseAvanzaOldList("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_LargeCap.SE&sortField=NAME&sortOrder=ASCENDING&activeTab=quote", largeCapPortfolio);
            //StockPortfolio viewAvanzaLargeCapStockPortfolio = Calculator.SetStockParameters(avanzaLargeCapStockPortfolio);
            StockPortfolio avanzaLargeCapStockPortfolioHistory      = AvanzaParsers.ParseAvanzaOldListHistory("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_LargeCap.SE&sectorId=ALL&page=1&sortField=NAME&sortOrder=ASCENDING&activeTab=history", avanzaLargeCapStockPortfolio);
            StockPortfolio avanzaLargeCapStockPortfolioOverview     = AvanzaParsers.ParseAvanzaOldListOverview("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_LargeCap.SE&sectorId=ALL&page=1&sortField=NAME&sortOrder=ASCENDING&activeTab=overview", avanzaLargeCapStockPortfolioHistory);
            StockPortfolio viewAvanzaLargeCapStockPortfolioOverview = Calculator.SetStockParameters(avanzaLargeCapStockPortfolioOverview);

            StockPortfolio midCapPortfolio            = new StockPortfolio("Mid Cap");
            StockPortfolio avanzaMidCapStockPortfolio = AvanzaParsers.ParseAvanzaOldList("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_MidCap.SE&sortField=NAME&sortOrder=ASCENDING&activeTab=quote", midCapPortfolio);
            //StockPortfolio viewAvanzaMidCapStockPortfolio = Calculator.SetStockParameters(avanzaMidCapStockPortfolio);
            StockPortfolio avanzaMidCapStockPortfolioHistory      = AvanzaParsers.ParseAvanzaOldListHistory("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_LargeCap.SE&sectorId=ALL&page=1&sortField=NAME&sortOrder=ASCENDING&activeTab=history", avanzaMidCapStockPortfolio);
            StockPortfolio avanzaMidCapStockPortfolioOverview     = AvanzaParsers.ParseAvanzaOldListOverview("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_MidCap.SE&sortField=NAME&sortOrder=ASCENDING&activeTab=overview", avanzaMidCapStockPortfolioHistory);
            StockPortfolio viewAvanzaMidCapStockPortfolioOverview = Calculator.SetStockParameters(avanzaMidCapStockPortfolioOverview);


            StockPortfolio smallCapPortfolio            = new StockPortfolio("Small Cap");
            StockPortfolio avanzaSmallCapStockPortfolio = AvanzaParsers.ParseAvanzaOldList("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_SmallCap.SE&sortField=NAME&sortOrder=ASCENDING&activeTab=quote", smallCapPortfolio);
            //StockPortfolio viewAvanzaSmallCapStockPortfolio = Calculator.SetStockParameters(avanzaSmallCapStockPortfolio);
            StockPortfolio avanzaSmallCapStockPortfolioHistory      = AvanzaParsers.ParseAvanzaOldListHistory("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_LargeCap.SE&sectorId=ALL&page=1&sortField=NAME&sortOrder=ASCENDING&activeTab=history", avanzaSmallCapStockPortfolio);
            StockPortfolio avanzaSmallCapStockPortfolioOverview     = AvanzaParsers.ParseAvanzaOldListOverview("https://www.avanza.se/aktier/gamla-aktielistan.html?countryCode=SE&marketPlaceOrList=LIST_SmallCap.SE&sortField=NAME&sortOrder=ASCENDING&activeTab=overview", avanzaSmallCapStockPortfolioHistory);
            StockPortfolio viewAvanzaSmallCapStockPortfolioOverview = Calculator.SetStockParameters(avanzaSmallCapStockPortfolioOverview);

            StockPortfolio allAvanzaStocks = new StockPortfolio("Avanza Stocks");
            allAvanzaStocks.Stocks = AddAllStocks(viewAvanzaLargeCapStockPortfolioOverview.Stocks, viewAvanzaMidCapStockPortfolioOverview.Stocks, viewAvanzaSmallCapStockPortfolioOverview.Stocks);
            allAvanzaStocks.Stocks = allAvanzaStocks.Stocks.OrderBy(x => x.Name).ToList();
            StockPortfolio allAvanzaStocksView = Calculator.SetStockParameters(allAvanzaStocks);

            string allAvanzaStocksJson = JsonCreator.CreateJson(allAvanzaStocksView);
            JsonCreator.SaveToRoot(allAvanzaStocksJson);
            #endregion
            ViewBag.Message = "These are the stocks currently added.";
            return(View(allAvanzaStocksView));
        }
Beispiel #10
0
    public static string GetLobbyListJson()
    {
        var jsonString = JsonConvert.SerializeObject(new NoAttributes());

        return(JsonCreator.RemoveSlash(JsonCreator.CreateJson(LobbyType.getLobby.ToString(), jsonString)));
    }