Ejemplo n.º 1
0
        resize(short count)
        {
            if (count == this.count)
            {
                return;
            }
            Desc[] desc = new Desc[count];

            if (trace.enabled(4))
            {
                trace.write(tr_id + ": resize " + this.count + " to " + count);
            }

            for (short col = 0; col < count; col++)
            {
                if (col < this.count)
                {
                    desc[col] = this.desc[col];
                }
                else
                {
                    desc[col] = new Desc(0);
                }
            }

            this.count = count;
            this.desc  = desc;
            return;
        }         // resize
Ejemplo n.º 2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (Desc.Name == null || Desc.Name.Length == 0)
            {
                if (Desc.HasAttribute <int>())
                {
                    sb.Append("$" + Desc.QueryAttribute <int>());
                }
                else
                {
                    sb.Append("?");
                }
            }
            else
            {
                sb.Append(Desc.Name);
            }
            sb.Append("'");
            sb.Append(Prop.ToString());
            foreach (Expression[] idx in GetFullIndices())
            {
                sb.Append("(");
                sb.Append(string.Join <Expression>(", ", idx));
                sb.Append(")");
            }

            return(sb.ToString());
        }
Ejemplo n.º 3
0
        public JsonValue ToJson(JsonSerializer serializer)
        {
            var json = new JsonObject();

            Id.Serialize(json, serializer, "id");
            Name.Serialize(json, serializer, "name");
            DisplayName.Serialize(json, serializer, "displayName");
            Desc.Serialize(json, serializer, "desc");
            Website.Serialize(json, serializer, "website");
            if (Prefs != null)
            {
                Prefs.PermissionLevel.Serialize(json, serializer, "prefs/permissionLevel");
                Prefs.OrgInviteRestrict.Serialize(json, serializer, "prefs/orgInviteRestrict");
                if (string.IsNullOrWhiteSpace(Prefs.AssociatedDomain))
                {
                    json.Add("prefs/associatedDomain", JsonValue.Null);
                }
                else
                {
                    Prefs.AssociatedDomain.Serialize(json, serializer, "prefs/associatedDomain");
                }
                if (Prefs.BoardVisibilityRestrict != null)
                {
                    Prefs.BoardVisibilityRestrict.Private.Serialize(json, serializer, "prefs/boardVisibilityRestrict/private");
                    Prefs.BoardVisibilityRestrict.Org.Serialize(json, serializer, "prefs/boardVisibilityRestrict/org");
                    Prefs.BoardVisibilityRestrict.Public.Serialize(json, serializer, "prefs/boardVisibilityRestrict/public");
                }
            }
            return(json);
        }
Ejemplo n.º 4
0
        public override string ToString()
        {
            var result = new StringBuilder();

            if (Desc.HasValue)
            {
                SonarHelpers.AppendUrl(result, "desc", Desc.ToString().ToLowerInvariant());
            }
            SonarHelpers.AppendUrl(result, "format", Format);
            SonarHelpers.AppendUrl(result, "key", Key);
            if (Libs.HasValue)
            {
                SonarHelpers.AppendUrl(result, "libs", Libs.ToString().ToLowerInvariant());
            }
            SonarHelpers.AppendUrl(result, "search", Search);
            if (Subprojects.HasValue)
            {
                SonarHelpers.AppendUrl(result, "subprojects", Subprojects.ToString().ToLowerInvariant());
            }
            if (Versions != null)
            {
                SonarHelpers.AppendUrl(result, "versions", Versions.ToString().Substring(1));
            }
            if (Views.HasValue)
            {
                SonarHelpers.AppendUrl(result, "views", Views.ToString().ToLowerInvariant());
            }

            return(result.Length > 0 ? "?" + result : string.Empty);
        }
        //Method converts last persisted database XML file to a database
        public DatabaseDictionary <int, Element <int, string> > XMLtoIntDB()
        {
            XDocument IntDBXML = XDocument.Load("PersistedIntDB.xml");
            var       Query    = from KV in IntDBXML.Elements("KeyValuePairs").Elements("KeyValuePair").Descendants() select KV;

            foreach (var KVP in Query)
            {
                if (KVP.Name.ToString() == "Key")
                {
                    DBKey = int.Parse(KVP.FirstAttribute.Value);
                }
                if (KVP.Name.ToString() == "Value")
                {
                    Element <int, string> DBElement = new Element <int, string>();
                    try
                    {
                        foreach (var Desc in KVP.Descendants())
                        {
                            if (Desc.Name.ToString() == "Name")
                            {
                                DBElement.NAME = Desc.Value.ToString();
                            }
                            if (Desc.Name.ToString() == "Description")
                            {
                                DBElement.DESCRIPTION = Desc.Value.ToString();
                            }
                            if (Desc.Name.ToString() == "Timestamp")
                            {
                                DateTime timestamp = DateTime.Parse(Desc.Value);
                                DBElement.TIMESTAMP = timestamp;
                            }
                            if (Desc.Name.ToString() == "Relations")
                            {
                                if (Desc.Descendants() == null)
                                {
                                    DBElement.RELATIONS = null;
                                }
                                List <int> Relations = new List <int>();
                                foreach (var Relation in Desc.Descendants())
                                {
                                    Relations.Add(int.Parse(Relation.Value));
                                }
                                DBElement.RELATIONS = Relations;
                            }
                            if (Desc.Name.ToString() == "Data")
                            {
                                DBElement.DATA = Desc.Value;
                            }
                        }
                    }
                    catch (Exception M)
                    {
                        Console.WriteLine(M.Message);
                    }

                    IntKeyDB.AddPair(DBKey, DBElement);
                }
            }
            return(IntKeyDB);
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Crear([FromBody] CrearViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Desc descripcion = new Desc
            {
                partidaidpartida             = model.idpartida,
                dispositivoiddispositivo     = model.iddispositivo,
                actividadidactividad         = model.idactividad,
                tipoactividadidtipoactividad = model.idtipoactividad,
                actividadadmidactividadadm   = model.idactividadadm,
                descripcion = model.descripcion
            };

            _context.Descripciones.Add(descripcion);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }

            return(Ok());
        }
Ejemplo n.º 7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Desc.Length != 0)
            {
                hash ^= Desc.GetHashCode();
            }
            if (HeroId != 0)
            {
                hash ^= HeroId.GetHashCode();
            }
            if (IsMale != false)
            {
                hash ^= IsMale.GetHashCode();
            }
            hash ^= modelMale_.GetHashCode();
            hash ^= modelFemale_.GetHashCode();
            if (CarrerIconPath.Length != 0)
            {
                hash ^= CarrerIconPath.GetHashCode();
            }
            return(hash);
        }
        public JsonValue ToJson(JsonSerializer serializer)
        {
            var json = new JsonObject();

            Id.Serialize(json, serializer, "id");
            Name.Serialize(json, serializer, "name");
            Desc.Serialize(json, serializer, "desc");
            Closed.Serialize(json, serializer, "closed");
            Subscribed.Serialize(json, serializer, "subscribed");
            Organization.SerializeId(json, "idOrganization");
            BoardSource.SerializeId(json, "idBoardSource");
            // Don't serialize the Preferences collection because Trello wants individual properties.
            if (Prefs != null)
            {
                Prefs.PermissionLevel.Serialize(json, serializer, "prefs/permissionLevel");
                Prefs.SelfJoin.Serialize(json, serializer, "prefs/selfJoin");
                Prefs.CardCovers.Serialize(json, serializer, "prefs/cardCovers");
                Prefs.Invitations.Serialize(json, serializer, "prefs/invitations");
                Prefs.Voting.Serialize(json, serializer, "prefs/voting");
                Prefs.Comments.Serialize(json, serializer, "prefs/comments");
                Prefs.CardAging.Serialize(json, serializer, "prefs/cardAging");
                Prefs.CalendarFeed.Serialize(json, serializer, "prefs/calendarFeedEnabled ");
                Prefs.Background.Serialize(json, serializer, "prefs/background");
            }
            return(json);
        }
Ejemplo n.º 9
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Desc.Length != 0)
            {
                hash ^= Desc.GetHashCode();
            }
            if (Str.Length != 0)
            {
                hash ^= Str.GetHashCode();
            }
            if (Value != 0)
            {
                hash ^= Value.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 10
0
 public virtual string GetDescriptionWithoutSpecialCharacters()
 {
     return(Desc
            .Replace('\n', ' ')
            .Replace('\"', '\'')
            .Replace("&", "and"));
 }
Ejemplo n.º 11
0
        internal override IFFFile Get()
        {
            var item = new Desc();

            item.Header.ID       = Reader().ReadUInt32();
            item.TextDescription = GetString(512);
            return(item);
        }
Ejemplo n.º 12
0
    public string Formatted(CultureInfo culture)
    {
        var date        = Date.ToString("d", culture);
        var description = Desc.Length > 25 ? $"{Desc.Substring(0, 22)}..." : Desc;
        var change      = Chg < 0.0 ? Chg.ToString("C", culture) : Chg.ToString("C", culture) + " ";

        return($"{date} | {description.PadRight(25)} | {change.PadLeft(13)}");
    }
Ejemplo n.º 13
0
 public virtual string GetDesc(params object[] ps)
 {
     if (!Desc.IsInvStr())
     {
         return(BaseLanguageMgr.Get(Desc, ps));
     }
     return(BaseLanguageMgr.Get(NarrationId + "_" + Index, ps));
 }
Ejemplo n.º 14
0
 public virtual string GetDesc(params object[] ps)
 {
     if (!Desc.IsInvStr())
     {
         return(BaseLanguageMgr.Get(Desc, ps));
     }
     return(BaseLanguageMgr.Get(TalkDescId, ps));
 }
Ejemplo n.º 15
0
 public override string GetDesc(params object[] ps)
 {
     if (!Desc.IsInv())
     {
         return(BaseLanguageMgr.Get(Desc, ps));
     }
     return(BaseLanguageMgr.Get(NarrationId + "_" + FragmentIndex, ps));
 }
Ejemplo n.º 16
0
    static void Main(string[] args)
    {
        string json   = File.ReadAllText("Sample.json");
        Desc   result = JsonConvert.DeserializeObject <Desc>(json);

        result.rgDescriptions.ForEach(s => Console.WriteLine(s.market_hash_name));
        Console.ReadLine();
    }
Ejemplo n.º 17
0
 public override string GetDesc(params object[] ps)
 {
     if (!Desc.IsInv())
     {
         return(BaseLanguageMgr.Get(Desc, ps));
     }
     return(BaseLanguageMgr.Get(TalkDescId, ps));
 }
Ejemplo n.º 18
0
 private void UpdateBossInViews()
 {
     BasicInfo.UpdateBoss(ActualBoss);
     Desc.UpdateBoss(ActualBoss);
     Weps.UpdateBoss(ActualBoss);
     Abilities.UpdateBoss(ActualBoss);
     Sounds.UpdateBoss(ActualBoss);
     CustomFiles.UpdateBoss(ActualBoss);
 }
        //implement method
        public override void InputFormFields()
        {
            RowLabel.SendKeys(Data.RowLabel);

            foreach (var Desc in RubricDescriptionList)
            {
                Desc.InputFormFields();
            }
        }
Ejemplo n.º 20
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.mid)
            {
                hashcode = (hashcode * 397) + Mid.GetHashCode();
            }
            if (__isset.name)
            {
                hashcode = (hashcode * 397) + Name.GetHashCode();
            }
            if (__isset.welcomeMessage)
            {
                hashcode = (hashcode * 397) + WelcomeMessage.GetHashCode();
            }
            if (__isset.profileImageObsHash)
            {
                hashcode = (hashcode * 397) + ProfileImageObsHash.GetHashCode();
            }
            if (__isset.desc)
            {
                hashcode = (hashcode * 397) + Desc.GetHashCode();
            }
            if (__isset.searchable)
            {
                hashcode = (hashcode * 397) + Searchable.GetHashCode();
            }
            if (__isset.type)
            {
                hashcode = (hashcode * 397) + Type.GetHashCode();
            }
            if (__isset.categoryID)
            {
                hashcode = (hashcode * 397) + CategoryID.GetHashCode();
            }
            if (__isset.invitationURL)
            {
                hashcode = (hashcode * 397) + InvitationURL.GetHashCode();
            }
            if (__isset.revision)
            {
                hashcode = (hashcode * 397) + Revision.GetHashCode();
            }
            if (__isset.ableToUseInvitationTicket)
            {
                hashcode = (hashcode * 397) + AbleToUseInvitationTicket.GetHashCode();
            }
            if (__isset.state)
            {
                hashcode = (hashcode * 397) + State.GetHashCode();
            }
        }
        return(hashcode);
    }
Ejemplo n.º 21
0
 public void UpdateAvailableImagesRec()
 {
     Desc.UpdateAvailableImages();
     HasChildrenWithImage = false;
     foreach (TaxonTreeNode child in _Children)
     {
         child.UpdateAvailableImagesRec();
         HasChildrenWithImage |= child.Desc.HasImage | child.HasChildrenWithImage;
     }
 }
Ejemplo n.º 22
0
 public static void PushOpen(string text, float _show_time = 1.8f)
 {
     if (MonoBehaviourSingleton <ToastManager> .IsValid())
     {
         Desc desc = new Desc();
         desc.text     = text;
         desc.showTime = _show_time;
         MonoBehaviourSingleton <ToastManager> .I.openInfoList.Add(desc);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Desc != null ? Desc.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 24
0
        internal void AddDesc(Desc desc)
        {
            descs.Add(desc);

            var strInfo = String.Format("{0}\n-----------------\n{1}",
                                        TranslateServerEx.Translate(Name + "_TITLE"),
                                        String.Join("\n", descs.Select(x => TranslateServerEx.Translate(x.Format, x.Params))));

            this.HintTooltip = strInfo;
        }
 protected override void SetupThreeButton(Desc data)
 {
     SetLabelText((Enum)UI.LBL_BTN_0, data.btnText[0]);
     SetLabelText((Enum)UI.LBL_BTN_0_R, data.btnText[0]);
     SetEventName((Enum)UI.SPR_BTN_0, "YES");
     SetButtonSprite((Enum)UI.SPR_BTN_0, CommonDialog.BTN_SPRITE_NAME[2], true);
     SetLabelText((Enum)UI.LBL_BTN_1, data.btnText[1]);
     SetLabelText((Enum)UI.LBL_BTN_1_R, data.btnText[1]);
     SetEventName((Enum)UI.SPR_BTN_1, "GO_ITEM_STORAGE");
 }
Ejemplo n.º 26
0
 void SaveBin(BinaryWriter _bw, SaveBinProgress _progress)
 {
     Desc.SaveBin(_bw);
     _progress.Inc();
     _bw.Write(Children.Count);
     foreach (TaxonTreeNode node in Children)
     {
         node.SaveBin(_bw, _progress);
     }
 }
Ejemplo n.º 27
0
        internal static List <MFAPublicKeyCredentialDescriptor> FromCore(this List <PublicKeyCredentialDescriptor> data)
        {
            var creds = new List <MFAPublicKeyCredentialDescriptor>();

            foreach (PublicKeyCredentialDescriptor Desc in data)
            {
                MFAPublicKeyCredentialDescriptor res = Desc.FromCore();
                creds.Add(res);
            }
            return(creds);
        }
Ejemplo n.º 28
0
        // Draw the item.
        public void DrawItem(DrawItemEventArgs e)
        {
            // Clear the background appropriately.
            e.DrawBackground();
            if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
            {
                e.Graphics.FillRectangle(new SolidBrush(Color.Yellow), e.Bounds);
            }
            else
            {
                e.Graphics.FillRectangle(new SolidBrush(SystemColors.Window), e.Bounds);
            }

            // Draw the image.
            float      hgt   = e.Bounds.Height - 2 * MarginHeight;
            float      scale = hgt / Picture.Height;
            float      wid   = Picture.Width * scale;
            RectangleF rect  = new RectangleF(
                e.Bounds.X + MarginWidth,
                e.Bounds.Y + MarginHeight,
                wid, hgt);

            e.Graphics.InterpolationMode = InterpolationMode.HighQualityBilinear;
            e.Graphics.DrawImage(Picture, rect);

            // Draw the text.
            // If we're drawing on the control,
            // draw only the first line of text.
            string visible_text = Desc;

            if (e.Bounds.Height < Picture.Height && Desc.IndexOf('\n') != -1)
            {
                visible_text = Desc.Substring(0, Desc.IndexOf('\n'));
            }

            // Make a rectangle to hold the text.
            wid  = e.Bounds.Width - rect.Right - 3 * MarginWidth;
            rect = new RectangleF(
                rect.Right + 2 * MarginWidth, rect.Y,
                wid, hgt);

            using (StringFormat sf = new StringFormat())
            {
                sf.Alignment                 = StringAlignment.Near;
                sf.LineAlignment             = StringAlignment.Center;
                e.Graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
                e.Graphics.DrawString(visible_text, Font, Brushes.Black, rect, sf);
            }

            e.Graphics.DrawRectangle(Pens.Transparent, Rectangle.Round(rect));

            // Draw the focus rectangle if appropriate.
            e.DrawFocusRectangle();
        }
Ejemplo n.º 29
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Desc.Length != 0)
            {
                hash ^= Desc.GetHashCode();
            }
            hash ^= dependencies_.GetHashCode();
            return(hash);
        }
Ejemplo n.º 30
0
            public LSLLibraryConstantSignature GetSignature(IReadOnlyGenericArray <string> subsets)
            {
                var s = Desc.Split(',');
                var t = s.Length == 3 ? LSLType.Vector : LSLType.Rotation;
                var f = new LSLLibraryConstantSignature(t, Name)
                {
                    DocumentationString = Desc
                };

                f.Subsets.SetSubsets(subsets);
                return(f);
            }
Ejemplo n.º 31
0
        /*
        ** Name: resize
        **
        ** Description:
        **	Adjusts the number of column descriptors.  Where possible,
        **	the original column descriptor information is retained.
        **
        ** Input:
        **	count	Number of descriptors.
        **
        ** Output:
        **	None.
        **
        ** Returns:
        **	void.
        **
        ** History:
        **	16-Apr-01 (gordy)
        **	    Created.
        **	31-Oct-02 (gordy)
        **	    Made private.
        */
        private void resize(short count)
        {
            if (count == this.count)  return ;
            Desc[] desc = new Desc[count];

            if (trace.enabled(4))
                trace.write(tr_id + ": resize " + this.count + " to " + count);

             for (short col = 0; col < count; col++)
                if (col < this.count)
                    desc[col] = this.desc[col];
                else
                    desc[col] = new Desc(0);

            this.count = count;
            this.desc = desc;
            return ;
        }
Ejemplo n.º 32
0
        /*
        ** Name: AdvanRSMD
        **
        ** Description:
        **	Class constructor.  Allocates descriptors as requested
        **	by the caller.  It is the callers responsibility to
        **	populate the descriptor information.
        **
        **
        ** Input:
        **	count	Number of descriptors.
        **	trace	Connection tracing.
        **
        ** Output:
        **	None.
        **
        ** Returns:
        **	None.
        **
        ** History:
        **	17-May-99 (gordy)
        **	    Created.
        **	28-Mar-01 (gordy)
        **	    Tracing added as a parameter.*/
        public AdvanRSMD(short count, ITrace trace)
        {
            this.count = count;
            this.trace = trace;

            desc = new Desc[count];
            for (int col = 0; col < count; col++)  desc[col] = new Desc(0);

            title = DrvConst.shortTitle + "-RSMD[" + inst_count + "]";
            tr_id = "RSMD[" + inst_count + "]";
            inst_count++;
            return;
        }
Ejemplo n.º 33
0
 public string Desc_Style(Desc<Thing> desc)
 {
     return string.Format("{1}{0}",desc,
         "## Special Encounter ##\n");
 }
Ejemplo n.º 34
0
        /*
         * Build a string describing a monster in some way.
         *
         * We can correctly describe monsters based on their visibility.
         * We can force all monsters to be treated as visible or invisible.
         * We can build nominatives, objectives, possessives, or reflexives.
         * We can selectively pronominalize hidden, visible, or all monsters.
         * We can use definite or indefinite descriptions for hidden monsters.
         * We can use definite or indefinite descriptions for visible monsters.
         *
         * Pronominalization involves the gender whenever possible and allowed,
         * so that by cleverly requesting pronominalization / visibility, you
         * can get messages like "You hit someone.  She screams in agony!".
         *
         * Reflexives are acquired by requesting Objective plus Possessive.
         *
         * I am assuming that no monster name is more than 65 characters long,
         * so that "char desc[80];" is sufficiently large for any result, even
         * when the "offscreen" notation is added.
         *
         * Note that the "possessive" for certain unique monsters will look
         * really silly, as in "Morgoth, King of Darkness's".  We should
         * perhaps add a flag to "remove" any "descriptives" in the name.
         *
         * Note that "offscreen" monsters will get a special "(offscreen)"
         * notation in their name if they are visible but offscreen.  This
         * may look silly with possessives, as in "the rat's (offscreen)".
         * Perhaps the "offscreen" descriptor should be abbreviated.
         *
         * Mode Flags:
         *   0x01 -. Objective (or Reflexive)
         *   0x02 -. Possessive (or Reflexive)
         *   0x04 -. Use indefinites for hidden monsters ("something")
         *   0x08 -. Use indefinites for visible monsters ("a kobold")
         *   0x10 -. Pronominalize hidden monsters
         *   0x20 -. Pronominalize visible monsters
         *   0x40 -. Assume the monster is hidden
         *   0x80 -. Assume the monster is visible
         *
         * Useful Modes:
         *   0x00 -. Full nominative name ("the kobold") or "it"
         *   0x04 -. Full nominative name ("the kobold") or "something"
         *   0x80 -. Banishment resistance name ("the kobold")
         *   0x88 -. Killing name ("a kobold")
         *   0x22 -. Possessive, genderized if visable ("his") or "its"
         *   0x23 -. Reflexive, genderized if visable ("himself") or "itself"
         */
        public string monster_desc(Desc in_mode)
        {
            string res = "ERROR IN MONSTER_DESC";
            int mode = (int)in_mode;

            Monster_Race r_ptr = Misc.r_info[r_idx];

            string name = r_ptr.Name;

            /* Can we "see" it (forced, or not hidden + visible) */
            bool seen = (((mode & (0x80)) != 0) || (((mode & (0x40)) == 0) && ml));

            /* Sexed Pronouns (seen and forced, or unseen and allowed) */
            bool pron = ((seen && ((mode & (0x20)) != 0)) || (!seen && ((mode & (0x10)) != 0)));

            /* First, try using pronouns, or describing hidden monsters */
            if (!seen || pron)
            {
                /* an encoding of the monster "sex" */
                int kind = 0x00;

                /* Extract the gender (if applicable) */
                if (r_ptr.flags.has(Monster_Flag.FEMALE.value)) kind = 0x20;
                else if (r_ptr.flags.has(Monster_Flag.MALE.value)) kind = 0x10;

                /* Ignore the gender (if desired) */
                if (!pron) kind = 0x00;

                /* Assume simple result */
                res = "it";

                /* Brute force: split on the possibilities */
                switch (kind + (mode & 0x07))
                {
                    /* Neuter, or unknown */
                    case 0x00: res = "it"; break;
                    case 0x01: res = "it"; break;
                    case 0x02: res = "its"; break;
                    case 0x03: res = "itself"; break;
                    case 0x04: res = "something"; break;
                    case 0x05: res = "something"; break;
                    case 0x06: res = "something's"; break;
                    case 0x07: res = "itself"; break;

                    /* Male (assume human if vague) */
                    case 0x10: res = "he"; break;
                    case 0x11: res = "him"; break;
                    case 0x12: res = "his"; break;
                    case 0x13: res = "himself"; break;
                    case 0x14: res = "someone"; break;
                    case 0x15: res = "someone"; break;
                    case 0x16: res = "someone's"; break;
                    case 0x17: res = "himself"; break;

                    /* Female (assume human if vague) */
                    case 0x20: res = "she"; break;
                    case 0x21: res = "her"; break;
                    case 0x22: res = "her"; break;
                    case 0x23: res = "herself"; break;
                    case 0x24: res = "someone"; break;
                    case 0x25: res = "someone"; break;
                    case 0x26: res = "someone's"; break;
                    case 0x27: res = "herself"; break;
                }
            }

            /* Handle visible monsters, "reflexive" request */
            else if ((mode & 0x02) != 0 && (mode & 0x01) != 0)
            {
                /* The monster is visible, so use its gender */
                if (r_ptr.flags.has(Monster_Flag.FEMALE.value)) res = "herself";
                else if (r_ptr.flags.has(Monster_Flag.MALE.value)) res = "himself";
                else res = "itself";
            }

            /* Handle all other visible monster requests */
            else
            {
                /* It could be a Unique */
                if (r_ptr.flags.has(Monster_Flag.UNIQUE.value))
                {
                    res = name;
                }

                /* It could be an indefinite monster */
                else if ((mode & 0x08) != 0)
                {
                    /* XXX Check plurality for "some" */

                    /* Indefinite monsters need an indefinite article */
                    res = "aeiouAEIOU".Contains(name[0]) ? "an" : "a";
                    res += name;
                }

                /* It could be a normal, definite, monster */
                else
                {
                    /* Definite monsters need a definite article */
                    res = "the " + name;
                }

                /* Handle the Possessive as a special afterthought */
                if ((mode & 0x02) != 0)
                {
                    /* XXX Check for trailing "s" */

                    /* Simply append "apostrophe" and "s" */
                    res += "'s";
                }

                /* Mention "offscreen" monsters XXX XXX */
                if (!Term.panel_contains(fy, fx))
                {
                    /* Append special notation */
                    res += " (offscreen)";
                }
            }

            /* Return the result */
            return res;
        }
Ejemplo n.º 35
0
	// ================================================================ //

	public override void		create(chrBehaviorEnemy behavior, ActionBase.DescBase desc_base = null)
	{
		base.create(behavior, desc_base);

		Desc	desc = desc_base as Desc;

		if(desc == null) {

			desc = new Desc(this.control.getPosition());
		}

		this.positions[0]  = desc.position0;
		this.positions[1]  = desc.position1;

		this.melee_attack = new MeleeAttackAction();
		this.melee_attack.create(this.behavior);
	}