Пример #1
0
        public void SetTime(RdlProperty time)
        {
            // Time property format:
            // 1:25 AM, Day 4 of Ebrum, Year 234 of the New Era.
            string timeString = time.GetValue <string>();
            int    hours      = Convert.ToInt32(timeString.Substring(0, 2).Replace(":", ""));

            if (timeString.Contains("PM"))
            {
                hours += 12;
            }

            // sundial rotation 360/24 == 15 degree rotation per hour.
            double rotation = (hours * 15);

            SundialRotateTransform.Angle = (rotation * -1) + SundialOffset;
            ToolTipService.SetToolTip(SundialImage, timeString);
        }
Пример #2
0
 public void SetProperty(RdlProperty property)
 {
     this.Property = property;
     lblName.Text  = property.Name;
     this.SetValue(property.Value);
 }
Пример #3
0
        private void ProcessRaces(RdlTagCollection tags)
        {
            List <RdlRace> races = tags.GetTags <RdlRace>(RdlTagName.OBJ.ToString(), RdlObjectTypeName.RACE.ToString());

            if (races.Count > 0)
            {
                Game.Races.Clear();
                RdlTagCollection raceTags = new RdlTagCollection();
                foreach (var item in races)
                {
                    raceTags.Add(item);
                    Race race = new Race
                    {
                        Name        = item.Name,
                        Description = item.Description,
                    };
                    RdlProperty prop = tags.GetProperty(item.ID, "Attr_Strength");
                    if (prop != null)
                    {
                        race.Strength = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Dexterity");
                    if (prop != null)
                    {
                        race.Dexterity = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Stamina");
                    if (prop != null)
                    {
                        race.Stamina = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Beauty");
                    if (prop != null)
                    {
                        race.Beauty = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Intelligence");
                    if (prop != null)
                    {
                        race.Intelligence = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Perception");
                    if (prop != null)
                    {
                        race.Perception = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Endurance");
                    if (prop != null)
                    {
                        race.Endurance = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }
                    prop = tags.GetProperty(item.ID, "Attr_Affinity");
                    if (prop != null)
                    {
                        race.Affinity = Convert.ToInt32(prop.Value);
                        raceTags.Add(prop);
                    }

                    Game.Races.Add(item.Name, race);
                }
                if (_hasRequiredQuota && StorageManager.RequiresFileUpdate(FileNames.Races))
                {
                    StorageManager.WriteTags(FileNames.Races, raceTags);
                }
            }
        }