public static string CheckCandidateDirection(bool expectVariants, List <Domain.Models.Alleles.CandidateAllele> candidateVariants,
                                                     string expectedDirectionString)
        {
            if (expectVariants)
            {
                if (candidateVariants.Count == 0)
                {
                    return("FN");
                }

                //foreach (var dirIndex in candidateVariants[0].SupportByDirection)
                for (int i = 0; i < candidateVariants[0].SupportByDirection.Length; i++)
                {
                    DirectionType dirType = (DirectionType)i;
                    if (candidateVariants[0].SupportByDirection[i] == 1)
                    {
                        return(dirType.ToString()[0].ToString());
                    }
                }
                return("FN");
            }
            else
            {
                //Assert.Equal(0, candidateVariants.Count);
                return("0");
            }
        }
예제 #2
0
        public static string GetDirectionName(string direction)
        {
            DirectionType t = GetDirection(direction);

            if (t == DirectionType.UNKNOWN)
            {
                return("");
            }
            return(t.ToString());
        }
예제 #3
0
        /// <summary>
        /// Spawn this new into the live world into a specified container
        /// </summary>
        /// <param name="spawnTo">the location/container this should spawn into</param>
        public override void SpawnNewInWorld(IGlobalPosition position)
        {
            //We can't even try this until we know if the data is there
            IPathwayTemplate bS = Template <IPathwayTemplate>() ?? throw new InvalidOperationException("Missing backing data store on pathway spawn event.");

            Keywords = new string[] { bS.Name.ToLower(), DirectionType.ToString().ToLower() };

            if (string.IsNullOrWhiteSpace(BirthMark))
            {
                BirthMark = LiveCache.GetUniqueIdentifier(bS);
                Birthdate = DateTime.Now;
            }

            DegreesFromNorth = bS.DegreesFromNorth;
            InclineGrade     = bS.InclineGrade;
            DirectionType    = Utilities.TranslateToDirection(DegreesFromNorth, InclineGrade);
            Descriptives     = bS.Descriptives;

            //paths need two locations
            if (bS.Origin.GetType() == typeof(RoomTemplate))
            {
                Origin = ((IRoomTemplate)bS.Origin).GetLiveInstance();
            }
            else
            {
                Origin = ((IZoneTemplate)bS.Origin).GetLiveInstance();
            }

            if (bS.Destination.GetType() == typeof(RoomTemplate))
            {
                Destination = ((IRoomTemplate)bS.Destination).GetLiveInstance();
            }
            else
            {
                Destination = ((IZoneTemplate)bS.Destination).GetLiveInstance();
            }


            CurrentLocation = (IGlobalPosition)Origin.CurrentLocation.Clone();
            Model           = bS.Model;

            //Enter = new Message(new string[] { bS.MessageToActor }, new string[] { "$A$ enters you" }, new string[] { }, new string[] { bS.MessageToOrigin }, new string[] { bS.MessageToDestination });
            //Enter.ToSurrounding.Add(MessagingType.Visible, new Tuple<int, IEnumerable<string>>(bS.VisibleStrength, new string[] { bS.VisibleToSurroundings }));
            //Enter.ToSurrounding.Add(MessagingType.Audible, new Tuple<int, IEnumerable<string>>(bS.AudibleStrength, new string[] { bS.AudibleToSurroundings }));

            UpsertToLiveWorldCache(true);

            Save();
        }
예제 #4
0
        public async Task <IEnumerable <USHolidaysAndTradingDatesResponse> > USHolidaysAndTradingDatesAsync(DateType type, DirectionType direction = DirectionType.Next, int last = 1, DateTime?startDate = null)
        {
            const string urlPattern = "ref-data/us/dates/[type]/[direction]/[last]/[startDate]";

            var qsb = new QueryStringBuilder();

            qsb.Add("token", _pk);

            var pathNvc = new NameValueCollection
            {
                { "type", type.ToString().ToLower() },
                { "direction", direction.ToString().ToLower() },
                { "last", last.ToString() },
                { "startDate", startDate == null?DateTime.Now.ToString("yyyyMMdd") : ((DateTime)startDate).ToString("yyyyMMdd") }
            };

            return(await _executor.ExecuteAsyncLegacy <IEnumerable <USHolidaysAndTradingDatesResponse> >(urlPattern, pathNvc, qsb));
        }
예제 #5
0
        private void AttachAdapter()
        {
            DeviceDir dir = Program.DeviceMgt.DeviceDirInfor;

            if (dir == null || dir.Header == null)
            {
                return;
            }

            _name      = dir.Header.RefDeviceName;
            _type      = dir.Header.Type;
            _direction = dir.Header.Direction;

            Program.Log.Write("License Controler initialized " +
                              " (DeviceName=" + _name +
                              ", DeviceType=" + _type.ToString() +
                              ", DeviceDirection=" + _direction.ToString() + ").");
        }
예제 #6
0
        private void AttachAdapter()
        {
            LicenseConfig licenseInfo = Program.License.Config;

            if (licenseInfo == null)
            {
                return;
            }

            _name      = licenseInfo.DeviceName;
            _type      = (DeviceType)Enum.Parse(typeof(DeviceType), licenseInfo.Type);
            _direction = (DirectionType)Enum.Parse(typeof(DirectionType), licenseInfo.Direction);

            _log.Write("License Controler initialized " +
                       " (DeviceName=" + _name +
                       ", DeviceType=" + _type.ToString() +
                       ", DeviceDirection=" + _direction.ToString() + ").");
        }
예제 #7
0
 public override void OnSingleClick(Mobile from)
 {
     LabelTo(from, "UOACZ Destination: " + m_GateDirection.ToString());
     LabelTo(from, "(" + m_ProfileTypeAllowed.ToString() + ")");
 }
예제 #8
0
파일: G2Header.cs 프로젝트: nandub/DeOps
 public override string ToString()
 {
     return(Address.ToString() + " " + Protocol.ToString() + " " + Direction.ToString());
 }
예제 #9
0
 private void WriteHsmsLog(byte[] secsBytes, DirectionType direction)
 {
     WriteHsmsLog("[" + direction.ToString() + "]:" + GetHexString(secsBytes));
 }
예제 #10
0
 public MouseAxis(DirectionType direction)
 {
     Direction = direction;
     Name      = _virtualKeyName = "Mouse Axis " + Direction.ToString();
 }
예제 #11
0
 public override string ToString()
 {
     return(Address + " " + Direction.ToString());
 }
예제 #12
0
 public void FaceDirection(DirectionType d)
 {
     if(d != m_currentDirection) {
         m_sprite.Play(d.ToString());
         m_currentDirection = d;
     }
 }
예제 #13
0
        /// <summary>
        /// Render this to a look command (what something sees when it 'look's at this
        /// </summary>
        /// <returns>the output strings</returns>
        public override ILexicalParagraph RenderToVisible(IEntity viewer)
        {
            short strength = GetVisibleDelta(viewer);

            IPathwayTemplate bS = Template <IPathwayTemplate>();
            ISensoryEvent    me = GetSelf(MessagingType.Visible, strength);

            if (bS.Descriptives.Any())
            {
                foreach (ISensoryEvent desc in bS.Descriptives)
                {
                    me.Event.TryModify(desc.Event);
                }
            }
            else
            {
                LexicalContext collectiveContext = new LexicalContext(viewer)
                {
                    Determinant = true,
                    Perspective = NarrativePerspective.SecondPerson,
                    Plural      = false,
                    Position    = LexicalPosition.Near,
                    Tense       = LexicalTense.Present
                };

                LexicalContext discreteContext = new LexicalContext(viewer)
                {
                    Determinant = true,
                    Perspective = NarrativePerspective.ThirdPerson,
                    Plural      = false,
                    Position    = LexicalPosition.Attached,
                    Tense       = LexicalTense.Present
                };

                Lexica verb = new Lexica(LexicalType.Verb, GrammaticalType.Verb, "leads", collectiveContext);

                //Fallback to using names
                if (DirectionType == MovementDirectionType.None)
                {
                    Lexica origin = new Lexica(LexicalType.Noun, GrammaticalType.DirectObject, Origin.TemplateName, discreteContext);
                    origin.TryModify(new Lexica(LexicalType.Noun, GrammaticalType.IndirectObject, Destination.TemplateName, discreteContext));
                    verb.TryModify(origin);
                }
                else
                {
                    Lexica direction = new Lexica(LexicalType.Noun, GrammaticalType.DirectObject, DirectionType.ToString(), discreteContext);
                    Lexica origin    = new Lexica(LexicalType.Noun, GrammaticalType.IndirectObject, Origin.TemplateName, discreteContext);
                    origin.TryModify(new Lexica(LexicalType.Noun, GrammaticalType.IndirectObject, Destination.TemplateName, discreteContext));
                    direction.TryModify(origin);
                }

                me.Event.TryModify(verb);
            }

            return(new LexicalParagraph(me));
        }