protected override float OnGetSlays(IFlagCollection flags) { float slays = 1.0f; // see if the attack has any flags that affect this monster's group(s) foreach (string group in Race.Groups) { if (flags.Has("useless-against-" + group)) { slays = 0.0f; } if (flags.Has("weak-against-" + group)) { slays *= 0.5f; } if (flags.Has("hurts-" + group)) { slays *= 2.0f; } if (flags.Has("wounds-" + group)) { slays *= 3.0f; } if (flags.Has("slays-" + group)) { slays *= 4.0f; } } return(slays); }
public Attack(Roller damage, int strikeBonus, float damageBonus, Element element, string verb, EffectType effectType, IFlagCollection flags) { mDamage = damage; mStrikeBonus = strikeBonus; mDamageBonus = damageBonus; mElement = element; Verb = verb; EffectType = effectType; mFlags = flags; }
public void UidAddFlagsSilent(int uid, IFlagCollection flags) { this.SourceClient.Command("uid store " + uid.ToString() + " +flags.silent " + ((FlagCollection)flags).Merged); }
/// <summary> /// Same as AddFlags() except no response is requested. /// </summary> /// <param name="messageOrdinal">The message's ordinal position.</param> /// <param name="flags">Flags to be added to the message.</param> /// <example><see cref="Mailbox.AddFlags"/></example> public void AddFlagsSilent(int messageOrdinal, IFlagCollection flags) { this.SourceClient.Command("store " + messageOrdinal.ToString() + " +flags.silent " + ((FlagCollection)flags).Merged); }
/// <summary> /// Sets the specified flags for the message. /// </summary> /// <param name="messageOrdinal">The message's ordinal position.</param> /// <param name="flags">Flags to be stored for the message.</param> /// <returns>The server's response.</returns> /// <example> /// <code> /// C# /// /// Imap4Client imap = new Imap4Client(); /// imap.Connect("mail.myhost.com"); /// imap.Login("jdoe1234","tanstaaf"); /// Mailbox inbox = imap.SelectInbox("inbox"); /// FlagCollection flags = new FlagCollection(); /// flags.Add("Read"); /// flags.Add("Answered"); /// inbox.AddFlags(1,flags); /// //Message is marked as read and answered. All prior flags are unset. /// imap.Disconnect(); /// /// VB.NET /// /// Dim imap As New Imap4Client /// imap.Connect("mail.myhost.com") /// imap.Login("jdoe1234","tanstaaf") /// Dim inbox As Mailbox = imap.SelectInbox("inbox") /// Dim flags As New FlagCollection /// flags.Add("Read") /// flags.Add("Answered") /// inbox.AddFlags(1,flags) /// 'Message is marked as read and answered. All prior flags are unset. /// imap.Disconnect() /// /// JScript.NET /// /// var imap:Imap4Client imap = new Imap4Client(); /// imap.Connect("mail.myhost.com"); /// imap.Login("jdoe1234","tanstaaf"); /// var inbox:Mailbox = imap.SelectInbox("inbox"); /// var flags:FlagCollection = new FlagCollection(); /// flags.Add("Read"); /// flags.Add("Answered"); /// inbox.AddFlags(1,flags); /// //Message is marked as read and answered. All prior flags are unset. /// imap.Disconnect(); /// </code> /// </example> public string SetFlags(int messageOrdinal, IFlagCollection flags) { return this.SourceClient.Command("store " + messageOrdinal.ToString() + " flags " + ((FlagCollection)flags).Merged); }
public IAsyncResult BeginUidRemoveFlags(int uid, IFlagCollection flags, AsyncCallback callback) { this._delegateUidRemoveFlags = this.UidRemoveFlags; return this._delegateUidRemoveFlags.BeginInvoke(uid, flags, callback, this._delegateUidRemoveFlags); }
public IAsyncResult BeginRemoveFlags(int messageOrdinal, IFlagCollection flags, AsyncCallback callback) { this._delegateRemoveFlags = this.RemoveFlags; return this._delegateRemoveFlags.BeginInvoke(messageOrdinal, flags, callback, this._delegateRemoveFlags); }
/// <summary> /// Appends the provided message to the mailbox. /// </summary> /// <param name="messageData">The message in a Rfc822 compliant format.</param> /// <param name="flags">Flags to be set for the message.</param> /// <example><see cref="Mailbox.Append"/></example> public string Append(byte[] messageData, IFlagCollection flags) { return this.Append(System.Text.Encoding.ASCII.GetString(messageData,0,messageData.Length),flags); }
protected virtual float OnGetSlays(IFlagCollection flags) { // no slays by default return(1.0f); }
/// <summary> /// Appends the provided message to the mailbox. /// </summary> /// <param name="messageData">The message in a Rfc822 compliant format.</param> /// <param name="flags">Flags to be set for the message.</param> /// <param name="dateTime">The internal date to be set for the message.</param> public string Append(byte[] messageData, IFlagCollection flags, DateTime dateTime) { return this.Append(System.Text.Encoding.UTF8.GetString(messageData,0,messageData.Length),flags,dateTime); }
/// <summary> /// Appends the provided message to the mailbox. /// </summary> /// <param name="message">The message to be appended.</param> /// <param name="flags">Flags to be set for the message.</param> /// <param name="dateTime">The internal date to be set for the message.</param> /// <example> /// <code> /// C# /// /// Message message = new Message(); /// message.From = new Address("*****@*****.**","John Doe"); /// message.To.Add("*****@*****.**","Mike Johns"); /// message.Subject = "hey!"; /// message.Attachments.Add("C:\\myfile.doc"); /// message.HtmlBody.Text = "As promised, the requested document.<br /><br />Regards,<br>John."; /// /// FlagCollection flags = new FlagCollection(); /// flags.Add("Read"); /// /// Imap4Client imap = new Imap4Client(); /// Mailbox inbox = imap.SelectMailbox("Read Messages"); /// inbox.Append(message,flags,System.DateTime.Now); /// imap.Disconnect(); /// /// VB.NET /// /// Dim message As New Message /// message.From = new Address("*****@*****.**","John Doe") /// message.To.Add("*****@*****.**","Mike Johns") /// message.Subject = "hey!" /// message.Attachments.Add("C:\myfile.doc") /// message.HtmlBody.Text = "As promised, the requested document.<br /><br />Regards,<br>John." /// /// Dim flags As New FlagCollection /// flags.Add("Read") /// /// Dim imap As New Imap4Client /// Dim inbox As Mailbox = imap.SelectMailbox("Read Messages") /// inbox.Append(message,flags,System.DateTime.Now) /// imap.Disconnect() /// /// JScript.NET /// /// var message:Message = new Message(); /// message.From = new Address("*****@*****.**","John Doe") /// message.To.Add("*****@*****.**","Mike Johns"); /// message.Subject = "hey!"; /// message.Attachments.Add("C:\\myfile.doc"); /// message.HtmlBody.Text = "As promised, the requested document.<br /><br />Regards,<br>John." /// /// var flags:FlagCollection = new FlagCollection(); /// flags.Add("Read"); /// /// var imap:Imap4Client = new Imap4Client(); /// var inbox:Mailbox = imap.SelectMailbox("Read Messages"); /// inbox.Append(message,flags,System.DateTime.Now); /// imap.Disconnect(); /// </code> /// </example> public string Append(Message message, IFlagCollection flags, DateTime dateTime) { return this.Append(message.ToMimeString(),flags,dateTime); }
public IAsyncResult BeginAppend(Message message, IFlagCollection flags, AsyncCallback callback) { this._delegateAppendMessageFlags = this.Append; return this._delegateAppendMessageFlags.BeginInvoke(message, flags, callback, this._delegateAppendMessageFlags); }
public IAsyncResult BeginAppend(string messageLiteral, IFlagCollection flags, DateTime dateTime, AsyncCallback callback) { this._delegateAppendFlagsDateTime = this.Append; return this._delegateAppendFlagsDateTime.BeginInvoke(messageLiteral, flags, dateTime, callback, this._delegateAppendFlagsDateTime); }
/// <summary> /// Appends the provided message to the mailbox. /// </summary> /// <param name="messageLiteral">The message in a Rfc822 compliant format.</param> /// <param name="flags">Flags to be set for the message.</param> /// <param name="dateTime">The internal date to be set for the message.</param> public string Append(string messageLiteral, IFlagCollection flags, DateTime dateTime) { string firststamp = System.DateTime.Now.ToString("yyMMddhhmmss"+System.DateTime.Now.Millisecond.ToString()); this.SourceClient.Command("APPEND \"" + this.Name + "\" " + ((FlagCollection)flags).Merged + " " + dateTime.ToString("r") + " {" + (messageLiteral.Length) + "}", firststamp); return this.SourceClient.Command(messageLiteral,"",firststamp); }
public IAsyncResult BeginSetFlagsSilent(int messageOrdinal, IFlagCollection flags, AsyncCallback callback) { this._delegateSetFlagsSilent = this.SetFlagsSilent; return this._delegateSetFlagsSilent.BeginInvoke(messageOrdinal, flags, callback, this._delegateSetFlagsSilent); }
public IAsyncResult BeginUidSetFlagsSilent(int uid, IFlagCollection flags, AsyncCallback callback) { this._delegateUidSetFlagsSilent = this.UidSetFlagsSilent; return this._delegateUidSetFlagsSilent.BeginInvoke(uid, flags, callback, this._delegateUidSetFlagsSilent); }
public IAsyncResult BeginAppend(byte[] messageData, IFlagCollection flags, DateTime dateTime, AsyncCallback callback) { this._delegateAppendByteFlagsDateTime = this.Append; return this._delegateAppendByteFlagsDateTime.BeginInvoke(messageData, flags, dateTime, callback, this._delegateAppendByteFlagsDateTime); }
public string UidAddFlags(int uid, IFlagCollection flags) { return this.SourceClient.Command("uid store " + uid.ToString() + " +flags " + ((FlagCollection)flags).Merged); }
/// <summary> /// Appends the provided message to the mailbox. /// </summary> /// <param name="messageLiteral">The message in a Rfc822 compliant format.</param> /// <param name="flags">Flags to be set for the message.</param> /// <param name="dateTime">The internal date to be set for the message.</param> public string Append(string messageLiteral, IFlagCollection flags, DateTime dateTime) { string firststamp = System.DateTime.Now.ToString("yyMMddhhmmss" + System.DateTime.Now.Millisecond.ToString()); // FIX by Hannes Sachsenhofer for Imapsy // Office365 did not like the non-standard date-format, so I changed it to the standard format var d = dateTime.ToUniversalTime().ToString("dd-MMM-yyyy hh:mm:ss +0000", CultureInfo.InvariantCulture); this.SourceClient.Command("APPEND \"" + this.Name + "\" " + ((FlagCollection)flags).Merged + " \"" + d + "\" {" + (messageLiteral.Length) + "}", firststamp); return this.SourceClient.Command(messageLiteral, "", firststamp); }