コード例 #1
0
 public void changeTrophyToObtained(Trophy trophy)
 {
     trophy.changeToObtained();
     SoundPlayer.Instance.playTrophySound();
     switch(trophy.name)
     {
         case "Medal3":
         case "Trophy3":
             //Score to add must be checked
             this.Client.sendData("@30505@" + 200.ToString());
             break;
         case "Medal2":
         case "Trophy2":
             //Score to add must be checked
             this.Client.sendData("@30505@" + 300.ToString());
             break;
         case "Medal1":
         case "Trophy1":
             //Score to add must be checked
             this.Client.sendData("@30505@" + 400.ToString());
             break;
         case "Airport":
             //Score to add must be checked
             this.Client.sendData("@30505@" + 700.ToString());
             break;
     }
     if (this.TrophyObtained != null)
     {
         this.TrophyObtained(this, new TrophyObtainedEventArgs { Trophy = trophy });
     }
 }
コード例 #2
0
ファイル: Star.cs プロジェクト: 113256/glitch-wars-unity
    void Start()
    {
        top = this.transform.parent.gameObject;
        trophy = top.transform.parent.gameObject.GetComponent<Trophy>();

        currency = GameObject.FindObjectOfType<Currency> ();
    }
コード例 #3
0
 /// <summary>
 /// Shows a <see cref="Trophy"/> unlock notification.
 /// </summary>
 /// <param name="trophy">The <see cref="Trophy"/> to display in the notification.</param>
 static void ShowNotification(Trophy trophy)
 {
     if (trophy.Unlocked)
     {
         UI.Manager.Instance.QueueNotification(
             string.Format("Unlocked <b>#{0}</b>", trophy.Title),
             trophy.Image);
     }
 }
コード例 #4
0
 public void InfoImage_Onclick()
 {
     audioInfoImage = audioInfoImage.GetComponent <AudioSource>();
     audioInfoImage.PlayDelayed(0f);
     InfoImage_final.SetActive(false);
     star1.SetActive(false);
     star2.SetActive(false);
     star3.SetActive(false);
     Trophy.SetActive(false);
 }
コード例 #5
0
 public static TrophyQLViewModel ToQueryViewModel(this Trophy entity,
                                                  TrophyQLViewModel model)
 {
     model.Id           = entity.Id;
     model.IsActive     = entity.IsActive;
     model.DocumentId   = entity.DocumentId;
     model.DocumentName = entity.Document != null ? entity.Document.Name : string.Empty;
     model.Name         = entity.Name;
     model.Description  = entity.Description;
     return(model);
 }
コード例 #6
0
        public Dictionary <int, Trophy> FindAllByAccountId(long accountId)
        {
            IEnumerable <dynamic>    results  = QueryFactory.Query(TableName).Where("account_id", accountId).Get();
            Dictionary <int, Trophy> trophies = new Dictionary <int, Trophy>();

            foreach (dynamic data in results)
            {
                Trophy trophy = (Trophy)ReadTrophy(data);
                trophies.Add(trophy.Id, trophy);
            }
            return(trophies);
        }
コード例 #7
0
ファイル: TROPCONF.cs プロジェクト: darkautism/TROPHYParser
        public TROPCONF(string path)
        {
            this.path = path;
            FileStream TROPCONFReader = null;
            if (path == null)
                throw new Exception("Path cannot be null!");

            if (!path.EndsWith(@"\"))
                path += @"\";

            if (!File.Exists(path + "TROPCONF.SFM"))
                throw new Exception("Cannot find TROPCONF.SFM.");

            try {
                TROPCONFReader = new FileStream(path + "TROPCONF.SFM", FileMode.Open);
            } catch (IOException) {
                throw new Exception("Cannot Open TROPCONF.SFM.");
            }

            TROPCONFReader.Position = startByte;
            byte[] data = new byte[TROPCONFReader.Length];
            TROPCONFReader.Read(data, 0, (int)TROPCONFReader.Length);
            string xml = Encoding.UTF8.GetString(data).Trim('\0');
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.LoadXml(xml);
            XmlElement root = xmldoc.DocumentElement;

            // Fixed Data
            trophyconf_version = root.Attributes["version"].Value;
            npcommid = xmldoc.GetElementsByTagName("npcommid")[0].InnerText;
            trophyset_version = xmldoc.GetElementsByTagName("trophyset-version")[0].InnerText;
            parental_level = xmldoc.GetElementsByTagName("parental-level")[0].InnerText;
            title_name = xmldoc.GetElementsByTagName("title-name")[0].InnerText;
            title_detail = xmldoc.GetElementsByTagName("title-detail")[0].InnerText;

            // Trophys
            XmlNodeList trophysXML = xmldoc.GetElementsByTagName("trophy");
            trophys = new List<Trophy>();
            foreach (XmlNode trophy in trophysXML) {
                Trophy item = new Trophy(
                    int.Parse(trophy.Attributes["id"].Value),
                    trophy.Attributes["hidden"].Value,
                    trophy.Attributes["ttype"].Value,
                    int.Parse(trophy.Attributes["pid"].Value),
                    trophy["name"].InnerText,
                    trophy["detail"].InnerText
                    );

                trophys.Add(item);
            }

            TROPCONFReader.Close();
        }
コード例 #8
0
 public long Insert(Trophy trophy)
 {
     return(QueryFactory.Query(TableName).InsertGetId <long>(new
     {
         trophy.Id,
         next_grade = trophy.NextGrade,
         trophy.Counter,
         is_done = trophy.IsDone,
         last_reward = trophy.LastReward,
         timestamps = JsonConvert.SerializeObject(trophy.Timestamps),
         character_id = trophy.CharacterId == 0 ? null : (long?)trophy.CharacterId,
         account_id = trophy.AccountId == 0 ? null : (long?)trophy.AccountId
     }));
 }