Example #1
0
 public Pipe(Game game, Rectangle rect, SosEngine.Level level, PipeTypes pipeType, string destination) :
     base(game, "", 0, 0)
 {
     this.rect = rect;
     if (rect.Width > rect.Height)
     {
         this.Orientation = PipeOrientation.Horizontal;
         if (pipeType == PipeTypes.Entrance)
         {
             this.rect.Inflate(-4, -4);
             this.rect.Offset(0, -8);
         }
     }
     else
     {
         this.Orientation = PipeOrientation.Vertical;
         if (pipeType == PipeTypes.Entrance)
         {
             this.rect.Inflate(-4, -4);
             this.rect.Offset(-4, 0);
         }
     }
     this.level       = level;
     this.PipeType    = pipeType;
     this.destination = destination;
 }
Example #2
0
    public void addPipe(PipeTypes pipeType, int amount)
    {
        if (noOfPipesOnDock.ContainsKey(pipeType))
        {
            noOfPipesOnDock[pipeType] += amount;
            updateIPipeCounter();
            updateLPipeCounter();
            return;
        }
        noOfPipesOnDock.Add(pipeType, amount);
        switch (pipeType)
        {
        case (PipeTypes.Straight):
            StraightPipe.SetActive(true);
            break;

        case (PipeTypes.L):
            LPipe.SetActive(true);
            break;

        default:
            break;
        }
        updateIPipeCounter();
        updateLPipeCounter();
    }
Example #3
0
    public Pipe removePipe(Pipe pipe)
    {
        GameObject newPipe  = Instantiate(pipe.gameObject, transform);
        PipeTypes  pipeType = pipe.getPipeType();

        noOfPipesOnDock[pipeType] -= 1;
        if (noOfPipesOnDock[pipeType] <= 0)
        {
            noOfPipesOnDock.Remove(pipeType);
            switch (pipeType)
            {
            case (PipeTypes.Straight):
                StraightPipe.SetActive(false);
                break;

            case (PipeTypes.L):
                LPipe.SetActive(false);
                break;

            default:
                break;
            }
        }
        updateLPipeCounter();
        updateIPipeCounter();
        return(newPipe.GetComponent <Pipe>());
    }
    public void binPipe()
    {
        PipeTypes destroyedPipeType = currentSelectedPipe.getPipeType();

        currentSelectedPipe.getGridBlock().setPipe(null);
        Destroy(currentSelectedPipe.gameObject);
        dock.addPipe(destroyedPipeType);
        soundManager.playSound("bin");
        selectionBox.remove();
        buttonManager.deactivateButtons();
    }
Example #5
0
 public Pipe()
 {
     lurd = new BitArray(4, false);
     watr = new BitArray(4, false);
     type = PipeTypes.Passive;
 }
Example #6
0
 public void UnSet()
 {
     lurd = new BitArray(4, false);
     type = PipeTypes.Passive;
 }
Example #7
0
 public void CalmDown()
 {
     type = PipeTypes.Passive;
 }
Example #8
0
 public void SetAgressive()
 {
     type = PipeTypes.Agressive;
 }
Example #9
0
 public void SetPipe(PipeTypes type, PipeForms form, float angleY)
 {
     pipeType = type;
     pipeForm = form;
     angle    = angleY;
 }
Example #10
0
 public void addPipe(PipeTypes pipeType)
 {
     addPipe(pipeType, 1);
 }