Наследование: PointOfViewCamera, IItem
Пример #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 Dungeon(Game game, IDungonBuilder builder) : base(game)
        {
            InitializeGraphics();
            Game.Components.Add(this);
            Builder = builder;


            ActiveLevels = new LevelCollection();
            var l = LoadLevel(0, null);//2, new Point(11, 14));
            Theron = new Theron(l.StartTile, Game);
            Game.Components.Add(Theron);
            Theron.LocationChanged += CurrentPlayer_LocationChanged;
            EnabledChanged += Dungeon_EnabledChanged;
        }
Пример #3
0
        public override async Task Run()
        {
            theron = ConsoleContext.AppContext.Theron;

            if (Parameters.Length == 0)
            {
                if (theron.Hand != null)
                    Output.WriteLine(theron.Hand.ToString());
                else
                    Output.WriteLine("Empty");
            }
            else if (Parameters.Length > 0)
            {
                switch (Parameters[0])
                {
                    case "take":
                        await TakeItem();
                        break;
                    case "takesub":
                        await TakeSubItem();
                        break;
                    case "put":
                        await PutItem();
                        break;
                    case "putsub":
                        await PutSubItem();
                        break;
                    case "throw":
                        ThrowItem();
                        break;
                    default:
                        Output.WriteLine("invalid command!");
                        break;
                }
            }
            else
            {
                Output.WriteLine("Invalid paramtetes");
            }
        }