public static Player CreatePlayer(PlayerInfo info)
        {
            var meleeWeaponSprite = new MeleeWeaponSprite(
                GetBitmap(info.MeleeWeaponTileMapPath),
                1, 0, 5, new Size(170, 170));

            var weaponSprites = new Dictionary <Type, Sprite>();

            foreach (var weaponType in WeaponFramesId.Keys)
            {
                weaponSprites.Add(
                    weaponType, new StaticSprite(
                        GetBitmap(info.WeaponsTileMapPath),
                        WeaponFramesId[weaponType],
                        new Size(79, 57)));
            }

            var weapons = new List <Weapon>();

            foreach (var weaponInfo in info.Weapons)
            {
                weapons.Add(AbstractWeaponFactory.CreateGun(weaponInfo));
            }

            var position       = info.Position.Copy();
            var angle          = info.Angle;
            var legs           = new PlayerBodySprite(position, GetBitmap(info.ClothesTileMapPath), 1, 14, 27, new Size(64, 64));
            var legsContainer  = new SpriteContainer(legs, position, angle);
            var torsoContainer = new SpriteContainer(weaponSprites[weapons[0].GetType()], position, angle);
            var meleeWeapon    = new MeleeWeapon(position, angle);

            return(new Player(
                       info.Health, info.Armor, new RigidCircle(position, 32, false, true),
                       legsContainer, torsoContainer, weapons, weaponSprites, meleeWeaponSprite, meleeWeapon, info.DeadBodyTileMapPath));
        }
        public static List <Collectable> CreateCollectables(List <CollectableWeaponInfo> collectablesInfo)
        {
            var collectables = new List <Collectable> {
                Capacity = 30
            };

            foreach (var info in collectablesInfo)
            {
                collectables.Add(AbstractWeaponFactory.CreateCollectable(info));
            }
            return(collectables);
        }
        public static Bot CreateBot(BotInfo info, List <Vector> patrolPoints)
        {
            var position       = info.Position.Copy();
            var angle          = info.Angle;
            var type           = BotBank.GetBotTypeInfo(info.Type);
            var legs           = new PlayerBodySprite(position, GetBitmap(type.ClothesTileMapPath), 1, 14, 27, new Size(64, 64));
            var torso          = new StaticSprite(GetBitmap(type.WeaponsTileMapPath), WeaponFramesId[type.Weapon.WeaponType], new Size(79, 57));
            var legsContainer  = new SpriteContainer(legs, position, angle);
            var torsoContainer = new SpriteContainer(torso, position, angle);
            var sightVector    = new Vector(1, 0).Rotate(-angle, Vector.ZeroVector).Normalize();

            return(new Bot(
                       type.Health, type.Armor, legsContainer, torsoContainer, sightVector,
                       new RigidCircle(position, 32, false, true),
                       AbstractWeaponFactory.CreateGun(type.Weapon), type.DeadBodyTileMapPath, patrolPoints));
        }