Engine:
- Added GameCommands namespace for holding all of the game command classes - Added ICommand interface for game commands. - Added IPlayer interface for player classes. - Added CommandLook for prepping the Test Runtime for looking at environments. Misc: - Updated Mud Designer Project Roadmap file (MudDesigner.pod)
This commit is contained in:
parent
7c72fbb2e8
commit
85aae88e34
6 changed files with 91 additions and 3 deletions
BIN
Mud Designer.pod
BIN
Mud Designer.pod
Binary file not shown.
|
@ -74,6 +74,7 @@
|
|||
<DependentUpon>Designer.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MudEngine\FileSystem\SaveDataTypes.cs" />
|
||||
<Compile Include="MudEngine\GameCommands\CommandLook.cs" />
|
||||
<Compile Include="MudEngine\GameManagement\GameScript.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Bag.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\BaseObject.cs" />
|
||||
|
@ -85,8 +86,10 @@
|
|||
<Compile Include="MudEngine\GameObjects\Environment\TravelDirections.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Environment\Zone.cs" />
|
||||
<Compile Include="MudEngine\GameObjects\Items\BaseItem.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\ICommand.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IFileIO.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IGameObject.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IPlayer.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IQuest.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IRoom.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IRuleSet.cs" />
|
||||
|
|
48
Mud Designer/MudEngine/GameCommands/CommandLook.cs
Normal file
48
Mud Designer/MudEngine/GameCommands/CommandLook.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using MudDesigner.MudEngine.FileSystem;
|
||||
using MudDesigner.MudEngine.GameCommands;
|
||||
using MudDesigner.MudEngine.GameManagement;
|
||||
using MudDesigner.MudEngine.GameObjects.Environment;
|
||||
using MudDesigner.MudEngine.GameObjects.Items;
|
||||
using MudDesigner.MudEngine.Interfaces;
|
||||
|
||||
namespace MudDesigner.MudEngine.GameCommands
|
||||
{
|
||||
public class CommandLook : IGameCommand
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public bool Override { get; set; }
|
||||
|
||||
public object Execute(params object[] parameters)
|
||||
{
|
||||
Room room = new Room() ;
|
||||
StringBuilder desc = new StringBuilder();
|
||||
|
||||
foreach (object obj in parameters)
|
||||
{
|
||||
if (obj is Room)
|
||||
room = (Room)obj;
|
||||
}
|
||||
|
||||
if (room == null)
|
||||
return null;
|
||||
|
||||
foreach (Door door in room.Doorways)
|
||||
{
|
||||
if (door.TravelDirection != MudDesigner.MudEngine.GameObjects.AvailableTravelDirections.Down && door.TravelDirection != MudDesigner.MudEngine.GameObjects.AvailableTravelDirections.Up)
|
||||
{
|
||||
desc.AppendLine("To the ");
|
||||
desc.Append(door.TravelDirection.ToString());
|
||||
desc.Append(" is ");
|
||||
desc.Append(door.ConnectedRoom);
|
||||
}
|
||||
}
|
||||
|
||||
return desc.ToString();
|
||||
}
|
||||
}
|
||||
}
|
17
Mud Designer/MudEngine/Interfaces/ICommand.cs
Normal file
17
Mud Designer/MudEngine/Interfaces/ICommand.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.Interfaces
|
||||
{
|
||||
public interface IGameCommand
|
||||
{
|
||||
//Name of the command
|
||||
string Name { get; set; }
|
||||
//Used to override commands with the same name
|
||||
bool Override { get; set; }
|
||||
//Executes the command.
|
||||
object Execute(params object[] Parameter);
|
||||
}
|
||||
}
|
11
Mud Designer/MudEngine/Interfaces/IPlayer.cs
Normal file
11
Mud Designer/MudEngine/Interfaces/IPlayer.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.Interfaces
|
||||
{
|
||||
public interface IPlayer : IGameObject
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,21 +1,30 @@
|
|||
using System;
|
||||
//.Net Framework
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
//Mud Designer
|
||||
using MudDesigner.MudEngine.GameCommands;
|
||||
using MudDesigner.MudEngine.FileSystem;
|
||||
using MudDesigner.MudEngine.GameManagement;
|
||||
using MudDesigner.MudEngine.GameObjects;
|
||||
using MudDesigner.MudEngine.GameObjects.Environment;
|
||||
using MudDesigner.MudEngine.GameObjects.Items;
|
||||
|
||||
namespace MudDesigner
|
||||
{
|
||||
public partial class Runtime : Form
|
||||
{
|
||||
|
||||
public Runtime()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void txtCommand_TextChanged(object sender, EventArgs e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue