void setPiece(Sprite image1, Sprite image2)
 {
     toggleImageMode(true);
     this.stimuli1ImageDisplay.sprite = image1;
     this.stimuli2ImageDisplay.sprite = image2;
     this.ID = new TSPieceID(image1, image2);
 }
 void setPiece(string stimuli1, string stimuli2)
 {
     toggleImageMode(false);
     this.stimuli1TextDisplay.text = stimuli1;
     this.stimuli2TextDisplay.text = stimuli2;
     this.ID = new TSPieceID(stimuli1, stimuli2);
 }
Exemple #3
0
    bool isValidPlacementHybrid(TSPieceID id, HybridTaskBatch hybridBatch, TSGameTile targetTile)
    {
        switch (targetTile.GetMatchCondition)
        {
        case TSMatchCondition.Stimuli1Category1:
            if (id.Stimuli1Image == null)
            {
                return(hybridBatch.IsValidStimuli1Category1(id.Stimuli1));
            }
            else
            {
                return(hybridBatch.IsValidStimuli1Category1(id.Stimuli1Image));
            }

        case TSMatchCondition.Stimuli1Category2:
            if (id.Stimuli1Image == null)
            {
                return(hybridBatch.IsValidStimuli1Category2(id.Stimuli1));
            }
            else
            {
                return(hybridBatch.IsValidStimuli1Category2(id.Stimuli1Image));
            }

        case TSMatchCondition.Stimuli2Category1:
            if (id.Stimuli2Image == null)
            {
                return(hybridBatch.IsValidStimuli2Category1(id.Stimuli2));
            }
            else
            {
                return(hybridBatch.IsValidStimuli2Category1(id.Stimuli2Image));
            }

        case TSMatchCondition.Stimuli2Category2:
            if (id.Stimuli2Image == null)
            {
                return(hybridBatch.IsValidStimuli2Category2(id.Stimuli2));
            }
            else
            {
                return(hybridBatch.IsValidStimuli2Category2(id.Stimuli2Image));
            }

        default:
            return(false);
        }
    }
Exemple #4
0
    bool isValidPlacement(TSGameTile sourceTile, TSGameTile targetTile)
    {
        TSPieceID id = sourceTile.GetPiece.ID;

        if (id.IsHybrid)
        {
            return(isValidPlacementHybrid(id, batch as HybridTaskBatch, targetTile));
        }
        else if (id.IsImages)
        {
            return(isValidPlacementImage(id, batch as ImageTaskBatch, targetTile));
        }
        else
        {
            return(isValidPlacementText(id, batch, targetTile));
        }
    }
Exemple #5
0
    bool isValidPlacementImage(TSPieceID id, ImageTaskBatch batch, TSGameTile targetTile)
    {
        switch (targetTile.GetMatchCondition)
        {
        case TSMatchCondition.Stimuli1Category1:
            return(batch.IsValidStimuli1Category1(id.Stimuli1Image));

        case TSMatchCondition.Stimuli1Category2:
            return(batch.IsValidStimuli1Category2(id.Stimuli1Image));

        case TSMatchCondition.Stimuli2Category1:
            return(batch.IsValidStimuli2Category1(id.Stimuli2Image));

        case TSMatchCondition.Stimuli2Category2:
            return(batch.IsValidStimuli2Category2(id.Stimuli2Image));

        default:
            return(false);
        }
    }
 void setPieceHybrid(ImageStimuliSet set)
 {
     toggleImageMode(set.HasImage1, STIM_1_INDEX);
     toggleImageMode(set.HasImage2, STIM_2_INDEX);
     if (set.HasImage1)
     {
         stimuli1ImageDisplay.sprite = set.Stimuli1Img;
     }
     else
     {
         stimuli1TextDisplay.text = set.Stimuli1;
     }
     if (set.HasImage2)
     {
         stimuli2ImageDisplay.sprite = set.Stimuli2Img;
     }
     else
     {
         stimuli2TextDisplay.text = set.Stimuli2;
     }
     if (set.HasImage1 && set.HasImage2)
     {
         this.ID = new TSPieceID(set.Stimuli1Img, set.Stimuli2Img, isHybrid: true);
     }
     else if (set.HasImage1 && !set.HasImage2)
     {
         this.ID = new TSPieceID(set.Stimuli1Img, set.Stimuli2);
     }
     else if (!set.HasImage1 && set.HasImage2)
     {
         this.ID = new TSPieceID(set.Stimuli1, set.Stimuli2Img);
     }
     else
     {
         this.ID = new TSPieceID(set.Stimuli1, set.Stimuli2, isHybrid: true);
     }
 }