public void ShowTradingPanel(Player localPlayer, Player[] playersToTradeWith, ExchangeHandler exchangeHandler, TradeHandler tradeHandler, TradeCancellation onTradeCancel)
    {
        this.localPlayer        = localPlayer;
        this.playersToTradeWith = playersToTradeWith;
        onExchange         = exchangeHandler;
        onTradeRequestSent = tradeHandler;
        this.onTradeCancel = onTradeCancel;

        // Select one player to trade with
        EnableExchangePanel();
        EnableClosability(true);
    }
Exemple #2
0
 public void Initialize(Player localPlayer, Player[] playersToTradeWith, TradeHandler handler, TradeCancellation onCancel)
 {
     fromStorage      = localPlayer.resources;
     fromSelected     = new ResourceStorage();
     toSelected       = new ResourceStorage();
     players          = playersToTradeWith;
     waitingForAnswer = false;
     InitializePlayers();
     ChangePlayer(players[0]);
     ShowTradeView(false);
     onTradeRequested = handler;
     this.onCancel    = onCancel;
 }