示例#1
0
        public MainGalaxyViewModel(IGalaxyPopulator initGalaxyCreator,
                                   IGalaxyViewModelFactory initGalaxyViewModelFactory,
                                   ISolarSystemViewModelFactory initSolarSystemViewModelFactory,
                                   IPlanetViewModelFactory initPlanetViewModelFactory,
                                   ITextOutputViewModel initTextOutputViewModel,
                                   ITickEngine initTickEngine)
        {
            _galaxyCreator = initGalaxyCreator;
            _tickEngine    = initTickEngine;

            _galaxyViewModelFactory      = initGalaxyViewModelFactory;
            _solarSystemViewModelFactory = initSolarSystemViewModelFactory;
            _planetViewModelFactory      = initPlanetViewModelFactory;

            TextOutput = initTextOutputViewModel;

            StarChart.InitialiseStarChart();
            ResourceTypes.InitialiseResourceTypes();
            BluePrints.InitialiseBluePrints();

            loadOrCreateGalaxy();
            initialiseEngine();

            saveGalaxy();
        }
示例#2
0
 public ProducerController(Producer p, PlanetController pc, IActorRef actorTextOutput)
 {
     _model           = p;
     _planetC         = pc;
     _actorTextOutput = actorTextOutput;
     _bp = BluePrints.GetBluePrint(p.BluePrintType);
 }
示例#3
0
    public void Start()
    {
        myBluePrint = AvalaibleBluePrints.available[(int)myBluePrintName];

        /*
         *      for(int i=0; i<AvalaibleBluePrints.available.Count;i++)
         *      {
         *              Debug.Log (AvalaibleBluePrints.available[i].name.ToString()+"/n");
         *      }
         */
    }
示例#4
0
    static public void SetUp()
    {
        //weapons
        BluePrints swordBluePrint = new BluePrints();

        swordBluePrint.type = BLUEPRINT_TYPE.WEAPON;
        swordBluePrint.name = BLUEPRINT_NAMES.Sword;
        swordBluePrint.required_resources = new Hashtable();
        swordBluePrint.required_resources.Add(RESOURCE_NAMES.scoropionTail, 1);
        available.Add(swordBluePrint);

        BluePrints BowBluePrint = new BluePrints();

        BowBluePrint.type = BLUEPRINT_TYPE.WEAPON;
        BowBluePrint.name = BLUEPRINT_NAMES.Bow;
        BowBluePrint.required_resources = new Hashtable();
        BowBluePrint.required_resources.Add(RESOURCE_NAMES.scoropionTail, 1);
        available.Add(BowBluePrint);

        BluePrints whipBluePrint = new BluePrints();

        whipBluePrint.type = BLUEPRINT_TYPE.WEAPON;
        whipBluePrint.name = BLUEPRINT_NAMES.Whip;
        whipBluePrint.required_resources = new Hashtable();
        whipBluePrint.required_resources.Add(RESOURCE_NAMES.scoropionTail, 1);
        available.Add(whipBluePrint);


        //tools
        BluePrints axeBluePrint = new BluePrints();

        axeBluePrint.type = BLUEPRINT_TYPE.TOOLS;
        axeBluePrint.name = BLUEPRINT_NAMES.Axe;
        axeBluePrint.required_resources = new Hashtable();
        axeBluePrint.required_resources.Add(RESOURCE_NAMES.wood, 2);
        axeBluePrint.required_resources.Add(RESOURCE_NAMES.scoropionTail, 1);
        available.Add(axeBluePrint);

        BluePrints pickAxeBluePrint = new BluePrints();

        pickAxeBluePrint.type = BLUEPRINT_TYPE.TOOLS;
        pickAxeBluePrint.name = BLUEPRINT_NAMES.PickAxe;
        pickAxeBluePrint.required_resources = new Hashtable();
        pickAxeBluePrint.required_resources.Add(RESOURCE_NAMES.wood, 2);
        pickAxeBluePrint.required_resources.Add(RESOURCE_NAMES.scoropionTail, 1);
        available.Add(pickAxeBluePrint);
    }
示例#5
0
        /// <summary>
        /// Adds the entity to the configuration, assign unique bleprintid
        /// </summary>
        /// <param name="entityInstance"></param>
        public void AddNewEntity(IEntity entityInstance)
        {
            //Generate a new Blueprint ID, it will represent this Blue print, and must be unique
            ushort newId;

            if (BluePrints.Count == 0)
            {
                // 1-255 cube resource values (0 - air)
                newId = 256;
            }
            else
            {
                newId = (ushort)(BluePrints.Values.Select(x => x.BluePrintId).Max() + 1);
            }

            entityInstance.BluePrintId = newId;
            //entityInstance.IsSystemEntity = false;

            BluePrints.Add(newId, (Entity)entityInstance);
        }
示例#6
0
 public void AddBluePrint(BluePrints bluePrint)
 {
     bluePrintInventory.Add(bluePrint);
     Debug.Log(bluePrint);
 }
示例#7
0
 public void SetUp(BLUEPRINT_NAMES newBluePrint)
 {
     myBluePrint     = AvalaibleBluePrints.available[(int)newBluePrint];
     myBluePrintName = newBluePrint;
 }
示例#8
0
 public Manufact(BluePrints bp)
 {
     BluePrints = bp;
 }