Click here to Skip to main content
13,403,145 members (51,183 online)

Design and Architecture

 
AnswerRe: indesign cs6 trial - no toolbar Pin
Pete O'Hanlon17-Jan-13 1:49
protectorPete O'Hanlon17-Jan-13 1:49 
QuestionHow do you design this? : with a better example Pin
VuNic30-Dec-12 18:57
memberVuNic30-Dec-12 18:57 
AnswerRe: How do you design this? : with a better example Pin
Christian Graus30-Dec-12 19:25
mvpChristian Graus30-Dec-12 19:25 
GeneralRe: How do you design this? : with a better example Pin
VuNic30-Dec-12 19:42
memberVuNic30-Dec-12 19:42 
GeneralRe: How do you design this? : with a better example Pin
Christian Graus30-Dec-12 19:46
mvpChristian Graus30-Dec-12 19:46 
AnswerRe: How do you design this? : with a better example Pin
jschell31-Dec-12 10:10
memberjschell31-Dec-12 10:10 
AnswerRe: How do you design this? : with a better example Pin
Eddy Vluggen31-Dec-12 18:04
memberEddy Vluggen31-Dec-12 18:04 
AnswerRe: How do you design this? : with a better example Pin
Keld Ølykke16-Jan-13 12:23
memberKeld Ølykke16-Jan-13 12:23 
It seems to me that you want to:
- mount ammo into a slot/inventory
- fire a weapon that can only fire if there is the right ammo in the slot/inventory

... so what about something like this:

interface IShip : IName
{
  IEnumerator<IGun> GunEnumerator
  {
    get;
  }

  IGun ActiveGun
  {
     get;
  }

  void ActivateGun(IGun gun);

  IAmmoInventory AmmoInventory
  {
    get;
  }
}

interface IGun : IName
{
  // point at something
  bool Aim(Vector3 directionLocal);
  
  // IGun knows its parent - IShip - with IAmmoInventory
  bool Fire();

}

interface IAmmoInventory
{
  IEnumerator<IAmmo> AmmoEnumerator
  {
    get;
  }

  void SelectAmmo(IAmmo ammo);

  IAmmo SelectedAmmo
  {
     get;
  }

  bool Add(IAmmo ammo);

  bool Remove(IAmmo ammo);
}

interface IAmmo : IName
{

  int Damage
  {
    get;
  }

  int Count
  {
     get;
  }
}

interface IName
{
  string Name
  {
    get;
  }
}


The Aim() part is pretty naive... but I hope you get the idea.

If IGun could be mounted on something that is not a ship, you could make interfaces like IGunOwner and IAmmoOwner that could be inherited by both IShip and IDeathStar Wink | ;)

Kind Regards,

Keld Ølykke
QuestionHow to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
ldaneil27-Dec-12 8:26
memberldaneil27-Dec-12 8:26 
AnswerRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
Pete O'Hanlon27-Dec-12 8:39
protectorPete O'Hanlon27-Dec-12 8:39 
GeneralRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
ldaneil27-Dec-12 8:50
memberldaneil27-Dec-12 8:50 
AnswerRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
jschell27-Dec-12 10:21
memberjschell27-Dec-12 10:21 
GeneralRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
ldaneil28-Dec-12 9:31
memberldaneil28-Dec-12 9:31 
AnswerRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
April Fans27-Dec-12 16:43
memberApril Fans27-Dec-12 16:43 
GeneralRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
ldaneil28-Dec-12 9:36
memberldaneil28-Dec-12 9:36 
GeneralRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
April Fans3-Jan-13 17:46
memberApril Fans3-Jan-13 17:46 
AnswerRe: How to find the similarity between users in Twitter ? How to design a good and efficient idea? Pin
Marc Koutzarov30-Aug-14 0:54
professionalMarc Koutzarov30-Aug-14 0:54 
QuestionMessage Closed Pin
23-Dec-12 19:46
memberasddderer4523-Dec-12 19:46 
QuestionClient - Server approach Pin
bugal21-Dec-12 1:33
memberbugal21-Dec-12 1:33 
AnswerRe: Client - Server approach Pin
jschell22-Dec-12 15:11
memberjschell22-Dec-12 15:11 
QuestionHow do you design this ? Pin
VuNic18-Dec-12 3:33
memberVuNic18-Dec-12 3:33 
AnswerRe: How do you design this ? Pin
Pete O'Hanlon18-Dec-12 3:47
protectorPete O'Hanlon18-Dec-12 3:47 
GeneralRe: How do you design this ? Pin
VuNic18-Dec-12 3:54
memberVuNic18-Dec-12 3:54 
GeneralRe: How do you design this ? Pin
Pete O'Hanlon18-Dec-12 4:02
protectorPete O'Hanlon18-Dec-12 4:02 
GeneralRe: How do you design this ? Pin
Lampridis Vasilis30-Dec-12 1:04
memberLampridis Vasilis30-Dec-12 1:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy |
Web03 | 2.8.1802120.2 | Last Updated 20 Feb 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid