예제 #1
0
        public static Entity BuildNakedMech(string label, bool player, Guidebook book)
        {
            var mech = new Entity(label: label, typeLabel: MechTypeLabel)
                       .AddComponent(new Component_Buffable())
                       .AddComponent(new Component_ActionExecutor(Config.DefaultEntityAP))
                       .AddComponent(new Component_Inventory())
                       .AddComponent(new Component_Skeleton());

            if (player)
            {
                mech.AddComponent(new Component_Player());
            }
            else if (book != null)
            {
                mech.AddComponent(new Component_AI(book));
            }
            else
            {
                throw new InvalidOperationException("book can't be null!");
            }

            SlotAt(mech, BodyPartLocation.LEFT_ARM, BlueprintListing.BuildForLabel(Blueprints.HAND));
            SlotAt(mech, BodyPartLocation.RIGHT_ARM, BlueprintListing.BuildForLabel(Blueprints.HAND));

            // Slot in all the required components
            return(mech);
        }
예제 #2
0
        public void TestLoadsFromResources()
        {
            // TODO: Put in loader
            // TODO: Test file in test project
            BlueprintListing.LoadAllBlueprints();

            var powerPlant = BlueprintListing.GetBlueprintByLabel(Blueprints.POWER_PLANT);

            Assert.AreEqual("Pwr.Plnt.", powerPlant.Label);

            var machinegun = BlueprintListing.GetBlueprintByLabel(Blueprints.MACHINEGUN);

            Assert.AreEqual("Mchngn.", machinegun.Label);
        }
예제 #3
0
 public void Initialize()
 {
     this.ent = new Entity();
     this.cmp = new TestComponent();
     BlueprintListing.LoadAllBlueprints();
 }
예제 #4
0
 public static Entity BuildArmorPart()
 {
     return(BlueprintListing.BuildForLabel(Blueprints.ARMOR));
 }