Ejemplo n.º 1
0
        public void ParseValidLoglineShouldParseWithoutError()
        {
            // #Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken
            var line = @"2015-02-05 08:01:02 W3SVC8 DEV-X41LBD3AE6F 100.100.100.100 GET / - 80 - 66.66.66.66 HTTP/1.1 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_9_5)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/40.0.2214.94+Safari/537.36 - - www.goblinfactory.co.uk 200 0 0 16133 387 1279";
            var hit  = Hit.Create(line);

            hit.ParseError.Should().BeFalse(hit.ErrorMessage);
        }
Ejemplo n.º 2
0
    public void AttemptAttack(Weapon weapon)
    {
        Assert.IsNotNull(weapon);

        if (entity != null)
        {
            cachedHit.Create(entity.gameObject, collider2D);
            entity.gameObject.GetComponent <CreatureEntity>().TakesMeleeHit(cachedHit);
        }
    }
    override public void OnWeaponCollisionEnter(Collider2D coll)
    {
        playerWeapon = coll.GetComponentInParent <Weapon>() ?? coll.GetComponentInParent <ProjectileContainer>().weapon;

        if (playerWeapon.type == Weapon.Type.Hammer ||
            playerWeapon.type == Weapon.Type.Dagger ||
            playerWeapon.type == Weapon.Type.MagicProjectile)
        {
            cachedHit.Create(gameObject, coll);
            TakesProjectileHit(cachedHit);
        }
    }
    void OnTriggerEnter2D(Collider2D coll)
    {
        layer = coll.gameObject.layer;

        if (layer == ENEMY_WEAPON_COLLIDER)
        {
            enemyWeapon = coll.GetComponent <Weapon>() ?? coll.GetComponentInParent <ProjectileContainer>().weapon;

            if (!enemyWeapon.alreadyCollided && !levelCompleted && !dead)
            {
                if (enemyWeapon.type == Weapon.Type.Hammer ||
                    enemyWeapon.type == Weapon.Type.Dagger ||
                    enemyWeapon.type == Weapon.Type.MagicProjectile)
                {
                    enemyWeapon.alreadyCollided = true;
                    cachedHit.Create(gameObject, coll);
                    SendMessageUpwards("TakesHit", cachedHit);
                }
            }
        }
    }