Esempio n. 1
0
        public void Portal_RightFaction()
        {
            Portal portal;

            var portalConfig = new SPortal()
            {
                FactionOrPortalId = 0
            };

            portal = new Portal(portalConfig);
            Assert.True(portal.IsSameFaction(CountryType.Light));
            Assert.True(portal.IsSameFaction(CountryType.Dark));

            portalConfig = new SPortal()
            {
                FactionOrPortalId = 1
            };
            portal = new Portal(portalConfig);
            Assert.True(portal.IsSameFaction(CountryType.Light));
            Assert.False(portal.IsSameFaction(CountryType.Dark));

            portalConfig = new SPortal()
            {
                FactionOrPortalId = 2
            };
            portal = new Portal(portalConfig);
            Assert.False(portal.IsSameFaction(CountryType.Light));
            Assert.True(portal.IsSameFaction(CountryType.Dark));
        }
Esempio n. 2
0
 public Portal(SPortal config)
 {
     _config = config;
     X1      = _config.Position.X - 5;
     X2      = _config.Position.X + 5;
     Y1      = _config.Position.Y - 5;
     Y2      = _config.Position.Y + 5;
     Z1      = _config.Position.Z - 5;
     Z2      = _config.Position.Z + 5;
 }
Esempio n. 3
0
        public void Portal_RightLevel()
        {
            var portalConfig = new SPortal()
            {
                MinLevel = 20,
                MaxLevel = 30,
            };
            var portal = new Portal(portalConfig);

            Assert.False(portal.IsRightLevel(9));
            Assert.False(portal.IsRightLevel(31));

            Assert.True(portal.IsRightLevel(20));
            Assert.True(portal.IsRightLevel(25));
            Assert.True(portal.IsRightLevel(30));
        }