示例#1
0
        public override async Task Run()
        {
            theron = ConsoleContext.AppContext.Theron;

            if (Parameters.Length > 0)
            {
                switch (Parameters[0])
                {
                    case "create":
                        int identifer = -1;
                        if (Parameters.Length == 2 && int.TryParse(Parameters[1], out identifer))
                        {
                            if (theron.Hand != null)
                                Output.WriteLine("Hand is not empty.");
                            else
                            {
                                var factory = new MiscItemFactory("Fake item", 0, new IAttackFactory[0], BackPackStorageType.Instance.ToEnumerable());
                                //TODO


                                theron.Hand = factory.Create(new MiscInitializator
                                {
                                    Attribute = 0
                                });
                                Output.Write($"Item: {theron.Hand} added to hand.");
                            }
                        }
                        else
                        {
                            Output.WriteLine("Invalid Parmeter");
                        }
                        break;
                }
            }
        }
示例#2
0
        public override async Task Run()
        {
            theron = ConsoleContext.AppContext.Theron;

            if (Parameters.Length > 0)
            {
                switch (Parameters[0])
                {
                case "create":
                    int identifer = -1;
                    if (Parameters.Length == 2 && int.TryParse(Parameters[1], out identifer))
                    {
                        if (theron.Hand != null)
                        {
                            Output.WriteLine("Hand is not empty.");
                        }
                        else
                        {
                            var factory = new MiscItemFactory("Fake item", 0, new IAttackFactory[0], BackPackStorageType.Instance.ToEnumerable());
                            //TODO


                            theron.Hand = factory.Create(new MiscInitializator
                            {
                                Attribute = 0
                            });
                            Output.Write($"Item: {theron.Hand} added to hand.");
                        }
                    }
                    else
                    {
                        Output.WriteLine("Invalid Parmeter");
                    }
                    break;
                }
            }
        }
示例#3
0
        public Miscellaneous(IMiscInitializer initializer, MiscItemFactory miscItemFactory)
        {
            this.TypeFacotry = miscItemFactory;

        }
示例#4
0
 public Miscellaneous(IMiscInitializer initializer, MiscItemFactory miscItemFactory)
 {
     TypeFacotry = miscItemFactory;
     ChargeCount = initializer.Attribute;
 }
示例#5
0
 public Miscellaneous(IMiscInitializer initializer, MiscItemFactory miscItemFactory)
 {
     this.TypeFacotry = miscItemFactory;
 }
 public void Initialize()
 {
     miscItemFactory = new MiscItemFactory();
     weaponFactory   = new WeaponFactory();
     potionFactory   = new PotionFactory();
 }