예제 #1
0
        //constructor
        public NodeInfo(Thing t)
        {
            type          = NodeInfoType.THING;
            index         = t.Index;
            action        = t.Action;
            tag           = t.Tag;
            polyobjnumber = ((t.Type > 9299 && t.Type < 9304) ? t.AngleDoom : int.MinValue);
            ThingTypeInfo tti = General.Map.Data.GetThingInfoEx(t.Type);

            defaultname = (tti != null ? tti.Title : "Thing");
        }
예제 #2
0
        // Copy constructor
        public NodeInfo(NodeInfo other, int neweffect)
        {
            this.type          = other.type;
            this.index         = other.index;
            this.action        = neweffect;
            this.tag           = other.tag;
            this.polyobjnumber = other.polyobjnumber;

            switch (type)
            {
            case NodeInfoType.LINEDEF:
                if (General.Map.Config.LinedefActions.ContainsKey(action))
                {
                    defaultname = General.Map.Config.LinedefActions[action].Title;
                }
                else if (action > 0 && GameConfiguration.IsGeneralized(action))
                {
                    defaultname = "Generalized (" + General.Map.Config.GetGeneralizedActionCategory(action) + ")";
                }
                else
                {
                    defaultname = "Linedef";
                }
                break;

            case NodeInfoType.SECTOR:
                if (General.Map.Config.SectorEffects.ContainsKey(action))
                {
                    defaultname = General.Map.Config.SectorEffects[action].Title;
                }
                else if (action > 0)
                {
                    defaultname = General.Map.Config.GetGeneralizedSectorEffectName(action);
                }
                else
                {
                    defaultname = "Sector";
                }
                break;

            default: throw new NotImplementedException("Not implemented...");
            }
        }
예제 #3
0
        public NodeInfo(Sector s, int tagindex)
        {
            type   = NodeInfoType.SECTOR;
            index  = s.Index;
            action = s.Effect;
            tag    = s.Tags[tagindex];

            if (General.Map.Config.SectorEffects.ContainsKey(action))
            {
                defaultname = General.Map.Config.SectorEffects[action].Title;
            }
            else if (action > 0)
            {
                defaultname = General.Map.Config.GetGeneralizedSectorEffectName(action);
            }
            else
            {
                defaultname = "Sector";
            }
        }
예제 #4
0
        public NodeInfo(Linedef l, int tagindex)
        {
            type          = NodeInfoType.LINEDEF;
            index         = l.Index;
            action        = l.Action;
            tag           = l.Tags[tagindex];
            polyobjnumber = ((l.Action > 0 && l.Action < 9) ? l.Args[0] : int.MinValue);

            if (General.Map.Config.LinedefActions.ContainsKey(action))
            {
                defaultname = General.Map.Config.LinedefActions[action].Title;
            }
            else if (action > 0 && GameConfiguration.IsGeneralized(action))
            {
                defaultname = "Generalized (" + General.Map.Config.GetGeneralizedActionCategory(action) + ")";
            }
            else
            {
                defaultname = "Linedef";
            }
        }
예제 #5
0
		public NodeInfo(Linedef ld)
		{
			type = NodeInfoType.LINEDEF;
			linedef = ld;
		}
예제 #6
0
		public NodeInfo(Sector s)
		{
			type = NodeInfoType.SECTOR;
			sector = s;
		}
예제 #7
0
		public NodeInfo(SectorGroup sg)
		{
			type = NodeInfoType.SECTOR_GROUP;
			sectorgroup = sg;
		}