示例#1
0
        //
        public void CreateSave(string playerName)
        {
            _id      = $"{userid}\\{playerName}";
            version  = ReferenceData.currentVersion;
            level    = -1;
            name     = playerName;
            health   = 5;
            AreaInfo = new AreaPath()
            {
                name = "Moceoy's Basement", path = "Neitsillia\\Casdam Ilse\\Central Casdam\\Moceoy's Basement\\Moceoy's Basement"
            };

            Area = Areas.AreaPartials.Area.Load(AreaInfo);

            equipment.weapon = Item.LoadItem("Wooden Spear");

            userSheet = new Sheet();
            userSheet.ModifyProperty("name", name);
            userSettings = new USettings(userid);
            userTimers   = new Timers(userid);

            respawnArea = "Neitsillia\\Casdam Ilse\\Central Casdam\\Moceoy's Basement\\Moceoy's Basement";

            quests = new List <Quest>()
            {
                Quest.Load(new int[] { 0, 0, 0 }),
                Quest.Load(new int[] { 0, 4, 0 }),
            };

            SaveFileMongo();
        }
        public override EventRuleElement GetRuleMatch(string collection, Configuration.EventRuleCollection eventRules)
        {
            var rule = eventRules.FirstOrDefault(r =>
                                                 r.Events.HasFlag(TfsEvents.WorkItemComment) &&
                                                 collection.IsMatchOrNoPattern(r.TeamProjectCollection) &&
                                                 ProjectName.IsMatchOrNoPattern(r.TeamProject) &&
                                                 WiType.IsMatchOrNoPattern(r.WorkItemType) &&
                                                 AreaPath.IsMatchOrNoPattern(r.AreaPath));

            return(rule);
        }
        public override EventRuleElement GetRuleMatch(string collection, Configuration.EventRuleCollection eventRules)
        {
            var rule = eventRules.FirstOrDefault(r =>
                                                 (r.Events.HasFlag(TfsEvents.WorkItemCreated) && IsNew ||
                                                  r.Events.HasFlag(TfsEvents.WorkItemChanged) && IsChangedFieldMatchOrNotSet(ChangedFields, r.WorkItemFieldItems)) &&
                                                 collection.IsMatchOrNoPattern(r.TeamProjectCollection) &&
                                                 ProjectName.IsMatchOrNoPattern(r.TeamProject) &&
                                                 WiType.IsMatchOrNoPattern(r.WorkItemType) &&
                                                 AreaPath.IsMatchOrNoPattern(r.AreaPath));

            return(rule);
        }
示例#4
0
        internal Party(string name, Player player)
        {
            _id       = name.ToLower();
            partyName = name;

            members = new List <PartyMember>
            {
                new PartyMember(player.userid, player.name)
            };
            NPCMembers      = new List <NPC>();
            areaKey         = player.areaPath;
            player.PartyKey = new AMIData.DataBaseRelation <string, Party>(_id, this);
        }
示例#5
0
/* Evandro
 *      public override void SaveToStream(System.Runtime.Serialization.SerializationInfo info, int orderNumber)
 *      {
 *          info.AddValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryStart, orderNumber),
 *              startPoint);
 *
 *          info.AddValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryEnd, orderNumber),
 *              endPoint);
 *
 *          base.SaveToStream (info, orderNumber);
 *      }
 *
 *      public override void LoadFromStream(SerializationInfo info, int orderNumber)
 *      {
 *          startPoint = (Point)info.GetValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryStart, orderNumber),
 *              typeof(Point));
 *
 *          endPoint = (Point)info.GetValue(
 *              String.Format(CultureInfo.InvariantCulture,
 *              "{0}{1}",
 *              entryEnd, orderNumber),
 *              typeof(Point));
 *
 *          base.LoadFromStream (info, orderNumber);
 *      }
 */

        /// <summary>
        /// Invalidate object.
        /// When object is invalidated, path used for hit test
        /// is released and should be created again.
        /// </summary>
        protected void Invalidate()
        {
            if (AreaPath != null)
            {
                AreaPath.Dispose();
                AreaPath = null;
            }

            if (AreaPen != null)
            {
                AreaPen.Dispose();
                AreaPen = null;
            }

            if (AreaRegion != null)
            {
                AreaRegion.Dispose();
                AreaRegion = null;
            }
        }
示例#6
0
        public override HitTestResult HitTestForSelection(ZWPictureBox pictureBox, Point point0)
        {
            //transfer point according to const draw area size for hit test
            Point        point   = new Point(point0.X * pictureBox.Width, point0.Y * pictureBox.Height);
            GraphicsPath pathOut = AreaPath.Clone() as GraphicsPath;
            Pen          pen     = new Pen(Color.Black, SelectionHitTestWidth * 2);

            pathOut.Widen(pen);
            Region rOut   = new Region(pathOut);
            bool   result = false;

            try
            {
                result = rOut.IsVisible(point);
            }
            catch (System.Exception ex)
            {
            }
            pathOut.Dispose();
            pen.Dispose();
            rOut.Dispose();

            return(result ? new HitTestResult(ElementType.Gate, 0) : new HitTestResult(ElementType.Nothing, -1));
        }
示例#7
0
 public void AddToAreaPaths(AreaPath areaPath)
 {
     base.AddObject("AreaPaths", areaPath);
 }
示例#8
0
 public static AreaPath CreateAreaPath(string path)
 {
     AreaPath areaPath = new AreaPath();
     areaPath.Path = path;
     return areaPath;
 }
示例#9
0
        public void PopulateShapeDataFromInfo(Visio.Shape shape, WorkItemShapeVersion shapeVersion)
        {
            // These changed between V1 and V2

            if (shapeVersion.Equals(WorkItemShapeVersion.V1))
            {
                shape.CellsU["Prop.CreatedBy"].FormulaU   = CreatedBy.WrapInDblQuotes();
                shape.CellsU["Prop.CreatedDate"].FormulaU = CreatedDate.WrapInDblQuotes();

                shape.CellsU["Prop.TeamProject"].FormulaU = TeamProject.WrapInDblQuotes();

                shape.CellsU["Prop.PageName"].FormulaU = WorkItemType.WrapInDblQuotes();

                shape.CellsU["Prop.State"].FormulaU = State.WrapInDblQuotes();

                shape.CellsU["Prop.ChangedBy"].FormulaU   = ChangedBy.WrapInDblQuotes();
                shape.CellsU["Prop.ChangedDate"].FormulaU = ChangedDate.WrapInDblQuotes();
            }
            else
            {
                // Map the properties to the corresponding Prop Data fields on the generic shape

                shape.CellsU["Prop.TextUpper2"].FormulaU = CreatedBy.WrapInDblQuotes();
                shape.CellsU["Prop.TextUpper1"].FormulaU = CreatedDate.WrapInDblQuotes();

                shape.CellsU["Prop.TextHeader2"].FormulaU = TeamProject.WrapInDblQuotes();

                shape.CellsU["Prop.WorkItemType"].FormulaU = WorkItemType.WrapInDblQuotes();

                //shape.CellsU["Prop.TextFooter2"].FormulaU = state.ToString().WrapInDblQuotes();
                shape.CellsU["Prop.TextFooter1"].FormulaU = State.WrapInDblQuotes();

                shape.CellsU["Prop.TextLower1"].FormulaU = ChangedBy.WrapInDblQuotes();
                shape.CellsU["Prop.TextLower2"].FormulaU = ChangedDate.WrapInDblQuotes();

                // Most likely PageName

                shape.CellsU["Prop.PageName"].FormulaU = $"{WorkItemType} {ID}".WrapInDblQuotes();

                shape.CellsU["Prop.RelatedBugs"].FormulaU = RelatedBugs.WrapInDblQuotes();
            }

            // These didn't change

            shape.CellsU["Prop.Organization"].FormulaU = Organization.WrapInDblQuotes();
            shape.CellsU["Prop.ID"].FormulaU           = ID.WrapInDblQuotes();

            shape.CellsU["Prop.Title"].FormulaU = Title.WrapInDblQuotes();

            shape.CellsU["Prop.RelatedLinks"].FormulaU  = RelatedLinkCount.WrapInDblQuotes();
            shape.CellsU["Prop.ExternalLinks"].FormulaU = ExternalLinkCount.WrapInDblQuotes();
            shape.CellsU["Prop.RemoteLinks"].FormulaU   = RemoteLinkCount.WrapInDblQuotes();
            shape.CellsU["Prop.HyperLinks"].FormulaU    = HyperLinkCount.WrapInDblQuotes();

            shape.CellsU["Prop.ExternalLink"].FormulaU =
                $"http://dev.azure.com/{Organization}/{TeamProject}/_workitems/edit/{ID}/".WrapInDblQuotes();

            shape.CellsU["Prop.AreaPath"].FormulaU      = AreaPath.WrapInDblQuotes();
            shape.CellsU["Prop.IterationPath"].FormulaU = IterationPath.WrapInDblQuotes();

            switch (WorkItemType)
            {
            case "Bug":
                shape.CellsU["Prop.FieldIssue"].FormulaU = FieldIssue.WrapInDblQuotes();
                break;

            case "User Story":
                shape.CellsU["Prop.TaskType"].FormulaU = TaskType.WrapInDblQuotes();
                break;

            default:
                break;
            }
        }
示例#10
0
 internal async Task SyncArea(AreaPath areaKey)
 {
     this.areaKey = areaKey;
     await SaveData();
 }
 public void PathClicked(AreaPath path)
 {
     _eventAggregator.PublishOnUIThreadAsync(new LocationBorderClick(path.AreaID));
 }
 public static Area Load(AreaPath path) => LoadArea(path.path, path.table);