public static bool CheckCondition(BaseEntity ent)
    {
        if (ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/wall-female"))
        {
            return(false);
        }
        if (ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/floor-female/1"))
        {
            return(false);
        }
        if (ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/floor-female/2"))
        {
            return(false);
        }
        if (ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/stability/2"))
        {
            return(false);
        }
        EntityLink entityLink = ent.FindLink("wall/sockets/neighbour/1");

        if (entityLink == null)
        {
            return(false);
        }
        for (int i = 0; i < entityLink.connections.Count; i++)
        {
            BuildingBlock item = entityLink.connections[i].owner as BuildingBlock;
            if (!(item == null) && !(item.blockDefinition.info.name.token != "roof") && Vector3.Angle(ent.transform.forward, -item.transform.forward) <= 10f)
            {
                return(true);
            }
        }
        return(false);
    }
 public override bool DoTest(BaseEntity ent)
 {
     if (ModelConditionTest_WallTriangleLeft.CheckCondition(ent))
     {
         return(false);
     }
     return(!ModelConditionTest_WallTriangleRight.CheckCondition(ent));
 }
Ejemplo n.º 3
0
    public static bool CheckCondition(BaseEntity ent)
    {
        if (ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/wall-female") || ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/floor-female/1") || (ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/floor-female/2") || ModelConditionTest_WallTriangleRight.CheckSocketOccupied(ent, "wall/sockets/stability/2")))
        {
            return(false);
        }
        EntityLink link = ent.FindLink("wall/sockets/neighbour/1");

        if (link == null)
        {
            return(false);
        }
        for (int index = 0; index < link.connections.Count; ++index)
        {
            BuildingBlock owner = link.connections[index].owner as BuildingBlock;
            if (!Object.op_Equality((Object)owner, (Object)null) && !(owner.blockDefinition.info.name.token != "roof") && (double)Vector3.Angle(((Component)ent).get_transform().get_forward(), Vector3.op_UnaryNegation(((Component)owner).get_transform().get_forward())) <= 10.0)
            {
                return(true);
            }
        }
        return(false);
    }