Checking in last changes made to MudEngine. This engine will be replaced.

This commit is contained in:
Scionwest_cp 2011-10-01 15:57:03 -07:00
parent c4345675d4
commit 5a39a7995e
14 changed files with 97 additions and 79 deletions

View file

@ -11,7 +11,8 @@ using MudEngine.Commands;
using MudEngine.GameManagement;
using MudEngine.GameObjects;
using MudEngine.GameObjects.Environment;
using MudEngine.GameObjects.Items;
using MudEngine.Items;
using MudEngine.Core;
using System.Net;
using System.Net.Sockets;
@ -372,6 +373,24 @@ namespace MudEngine.GameObjects.Characters
gc.Execute("Look", this); //MUST happen after Room setup is completed, otherwise the player default Abyss Room is printed.
this.Send("Command: ", false);
}
public virtual void OnCreate()
{
}
public virtual void OnDestroy()
{
}
public virtual void OnEquip()
{
}
public virtual void OnUnequip()
{
}
internal void Receive(String data)
{
//data = ExecuteCommand(data);

View file

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace MudEngine.Core
{
public abstract class BaseEnvironment : BaseObject
{
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You don't smell anything unsual.")]
public String Smell { get; set; }
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You hear nothing of interest.")]
public String Listen { get; set; }
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You feel nothing.")]
public String Feel { get; set; }
public BaseEnvironment(BaseGame game) : base(game)
{
this.Feel = "You feel nothing.";
this.Listen = "You hear nothing of interest.";
this.Smell = "You don't smell anything unsual.";
}
public virtual void OnEnter()
{
}
public virtual void OnExit()
{
}
}
}

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MudEngine.Core
{
public abstract class BaseGame
{
}
}

View file

@ -6,7 +6,7 @@ using System.Text;
using MudEngine.GameManagement;
namespace MudEngine.GameObjects.Items
namespace MudEngine.Core
{
public class BaseItem : BaseObject
{

View file

@ -15,9 +15,9 @@ using MudEngine.GameManagement;
using rScripting;
using rScripting.LateBinding;
namespace MudEngine.GameObjects
namespace MudEngine.Core
{
public class BaseObject
public abstract class BaseObject
{
[Category("Object Setup")]
[Description("The Display Name assigned to this object.")]
@ -87,37 +87,18 @@ namespace MudEngine.GameObjects
protected virtual String SavePath { get; set; }
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You don't smell anything unsual.")]
public String Smell { get; set; }
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You hear nothing of interest.")]
public String Listen { get; set; }
[Category("Environment Information")]
[Description("If a user asks to use his/her senses to investigate an area, this is one of the results that will be displayed. Senses can be used to assist blind characters.")]
[DefaultValue("You feel nothing.")]
public String Feel { get; set; }
public Game ActiveGame { get; set; }
public BaseGame ActiveGame { get; set; }
/// <summary>
/// Initializes the base object
/// </summary>
public BaseObject(Game game)
public BaseObject(BaseGame game)
{
Name = "New " + this.GetType().Name;
ActiveGame = game;
DetailedDescription = new List<String>();
this.Feel = "You feel nothing.";
this.Listen = "You hear nothing of interest.";
this.Smell = "You don't smell anything unsual.";
this.Name = DefaultName();
this.Filename = DefaultName() + "." + this.GetType().Name;
}
@ -142,39 +123,7 @@ namespace MudEngine.GameObjects
return this.Name;
}
public virtual void Start()
{
}
public virtual void OnEnter()
{
}
public virtual void OnExit()
{
}
public virtual void OnCreate()
{
}
public virtual void OnDestroy()
{
}
public virtual void OnEquip()
{
}
public virtual void OnUnequip()
{
}
public virtual void OnMount()
{
}
public virtual void OnDismount()
public virtual void Initialize()
{
}
@ -195,9 +144,6 @@ namespace MudEngine.GameObjects
FileManager.WriteLine(filename, this.Name, "Name");
FileManager.WriteLine(filename, this.Description, "Description");
FileManager.WriteLine(filename, this.Feel, "Feel");
FileManager.WriteLine(filename, this.Listen, "Listen");
FileManager.WriteLine(filename, this.Smell, "Smell");
foreach (String line in DetailedDescription)
FileManager.WriteLine(filename, line, "DetailedDescription");
@ -215,10 +161,6 @@ namespace MudEngine.GameObjects
}
this.Name = FileManager.GetData(filename, "Name");
this.Description = FileManager.GetData(filename, "Description");
this.Feel = FileManager.GetData(filename, "Feel");
this.Listen = FileManager.GetData(filename, "Listen");
this.Smell = FileManager.GetData(filename, "Smell");
List<String> data = FileManager.GetCollectionData(filename, "DetailedDescription");
foreach (String line in data)

View file

@ -18,6 +18,7 @@ using MudEngine.GameObjects.Characters;
using MudEngine.GameObjects.Environment;
using MudEngine.Scripting;
using MudEngine.Networking;
using MudEngine.Core;
namespace MudEngine.GameManagement
{
@ -26,7 +27,7 @@ namespace MudEngine.GameManagement
/// </summary>
[XmlInclude(typeof(StartingLocation))]
[XmlInclude(typeof(Currency))]
public class Game
public class Game : BaseGame
{
#region ==== Properties & Types ====

View file

@ -11,7 +11,7 @@ using MudEngine.GameManagement;
using MudEngine.GameObjects;
using MudEngine.GameObjects.Characters;
using MudEngine.GameObjects.Environment;
using MudEngine.GameObjects.Items;
using MudEngine.Core;
using MudEngine.Scripting;
namespace MudEngine.GameManagement

View file

@ -5,11 +5,11 @@ using System.Linq;
using System.Text;
//MUD Engine
using MudEngine.GameObjects.Items;
using MudEngine.Core;
namespace MudEngine.GameObjects
namespace MudEngine.Items
{
public class Bag : BaseObject
public class Bag : BaseItem
{
/// <summary>
/// Gets or Sets the size of the bag.
@ -20,7 +20,7 @@ namespace MudEngine.GameObjects
set;
}
private List<Items.BaseItem> Items { get; set; }
private List<BaseItem> Items { get; set; }
public Bag(GameManagement.Game game) : base(game)
{

View file

@ -5,9 +5,11 @@ using System.Linq;
using System.Text;
using System.ComponentModel;
using MudEngine.Core;
namespace MudEngine.GameObjects
{
public class Currency : BaseObject
public class Currency : BaseItem
{
[Category("Currency Settings")]
[Description("The value of the currency is based off the BaseCurrencyValue set in the Project Information. If BaseCurrencyValue is 1, and a new Currency is 10, then it will take 10 BaseCurrency to equal 1 of the new Currencies.")]

View file

@ -55,6 +55,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Core\BaseCommand.cs" />
<Compile Include="Core\BaseEnvironment.cs" />
<Compile Include="Core\BaseGame.cs" />
<Compile Include="DAL\SaveDataPaths.cs" />
<Compile Include="Commands\CommandSystem.cs" />
<Compile Include="Game\GameTime.cs" />
@ -93,9 +95,7 @@
<Name>rScripting</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="GameManagement\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -7,7 +7,7 @@ using System.Xml.Serialization;
using System.ComponentModel;
//MUD Engine
using MudEngine.GameObjects.Items;
using MudEngine.Core;
using MudEngine.GameManagement;
namespace MudEngine.GameObjects.Environment

View file

@ -9,10 +9,11 @@ using System.ComponentModel;
//MUD Engine
using MudEngine.FileSystem;
using MudEngine.GameObjects;
using MudEngine.Core;
namespace MudEngine.GameObjects.Environment
{
public class Realm : BaseObject
public class Realm : BaseEnvironment
{
[Category("Environment Information")]

View file

@ -10,7 +10,7 @@ using System.IO;
//MUD Engine
using MudEngine.FileSystem;
using MudEngine.GameObjects.Items;
using MudEngine.Core;
using MudEngine.GameManagement;
namespace MudEngine.GameObjects.Environment

View file

@ -11,7 +11,8 @@ using System.Xml.Serialization;
using MudEngine.FileSystem;
using MudEngine.GameManagement;
using MudEngine.GameObjects;
using MudEngine.GameObjects.Items;
using MudEngine.Items;
using MudEngine.Core;
namespace MudEngine.GameObjects.Environment
{