???
Математика на уровне МГУ

Показано с 1 по 3 из 3

Тема: IPlayer question

  1. #1
    Заявка на ПМЖ
    Регистрация
    06.07.2011
    Возраст
    43
    Сообщений
    12

    IPlayer question

    I got this script from Japanese forums:
    http://silkyskyjp.blogspot.ie/2013/0...-of-dover.html

    Some parts of this class like "bulletsFire" don`t work for some reason....

    Anyone have experienced it???

    Код:
      private string GetDictionary<T>(Dictionary<string, T> ds)
        {
            StringBuilder sb = new StringBuilder();
            foreach (string key in ds.Keys)
            {
                T d = ds[key];
                if (sb.Length != 0)
                {
                    sb.Append(", ");
                }
                //sb.AppnedFormat("[{0}]={1}", key, d);
            }
            return sb.ToString();
        }
    
        public string WritePlayerStat(Player player)
        {
            if (player is IPlayer)
            {
                IPlayerStat st = (player as IPlayer).GetBattleStat();
                string stats = (String.Format("PlayerStat[{0}] bulletsFire={1}, landings={2}, kills={3}, fkills={4}, deaths={5}, bails={6}, ditches={7}, planeChanges={8}, planesWrittenOff={9}, netBattles={10}, singleBattles={11}, tccountry={12}, killsTypes=\"{13}\", tTotalTypes=\"{14}\"",
                    player.Name(), st.bulletsFire.ToString(), st.landings, st.kills, st.fkills, st.deaths, st.bails, st.ditches, st.planeChanges, st.planesWrittenOff, st.netBattles, st.singleBattles, st.tccountry, GetDictionary(st.killsTypes), GetDictionary(st.tTotalTypes)));
    
                return stats;
            }
            else
            {
                return string.Empty;
            }
        }

  2. #2

    Re: IPlayer question

    Sorry, never used this interface. How exactly do not they work?

  3. #3
    Заявка на ПМЖ
    Регистрация
    06.07.2011
    Возраст
    43
    Сообщений
    12

    Re: IPlayer question

    There is IPlayerStat interface there which contain various classes like:
    int bails { get; },
    int bombsFire { get; },
    int bombsHit { get; }....

    and it ends on :
    tTotalTypes { get; }

    some of theme are just not responding if I want to call theme our with this:

    IPlayerStat st = (player as IPlayer). GetBattleStat ();

    I mean there is no response from theme. Some of them works though, like "kills", or "deaths", "bails"

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •