AddScribbler() public method

public AddScribbler ( GrabbableScribbler, scribbler ) : void
scribbler GrabbableScribbler,
return void
コード例 #1
0
    public void PutInHolder(GrabbableScribbler scribbler, ScribblerHolder targetHolder)
    {
        targetHolder.AddScribbler(scribbler);

        bool isPuzzleSolved = false;

        if (NumScribblersInHolders() == allScribblers.Count)
        {
            isPuzzleSolved = true;             // Flip bool before this for-loop
            foreach (ScribblerHolder holder in allHolders)
            {
                if (!holder.AreAllScribblersOfTheSameType())
                {
                    isPuzzleSolved = false;
                    break;
                }
            }
        }

        if (isPuzzleSolved)
        {
            Debug.Log("Scribbler sorting puzzle is solved!");
            CompletePuzzle();
        }
    }
コード例 #2
0
	public void PutInHolder(GrabbableScribbler scribbler, ScribblerHolder targetHolder)
	{
		targetHolder.AddScribbler(scribbler);

		bool isPuzzleSolved = false;
		if (NumScribblersInHolders() == allScribblers.Count) {
			isPuzzleSolved = true; // Flip bool before this for-loop
			foreach (ScribblerHolder holder in allHolders) {
				if (!holder.AreAllScribblersOfTheSameType()) {
					isPuzzleSolved = false;
					break;
				}
			}
		}

		if (isPuzzleSolved) {
			Debug.Log("Scribbler sorting puzzle is solved!");
		}
	}