Primarily a bug fix check-in

This commit is contained in:
Scionwest_cp 2012-03-10 14:23:13 -08:00
parent bcd9f46b0a
commit 9b475691d5
10 changed files with 35 additions and 48 deletions

View file

@ -123,10 +123,18 @@ namespace MudEngine.Core
/// <returns></returns>
public BaseScript this[Int32 index]
{
//TODO: Perform some exception handling here.
//TODO: Don't allow setting if isReadOnly=true
get { return (BaseScript)this.scriptCollection[index]; }
set { this.scriptCollection[index] = value; }
get
{
if (index <= this.Count - 1)
return (BaseScript)this.scriptCollection[index];
else //If the index is out of bounds, just return the last item in the collection.
return (BaseScript)this.scriptCollection[this.scriptCollection.Count - 1];
}
set
{
if (!this.IsReadOnly)
this.scriptCollection[index] = value;
}
}
#endregion