Ejemplo n.º 1
0
        /// <summary>Add the <code>StartChannelListener</code> for the specified URI.</summary>
        /// <param name="profile"></param>
        /// <param name="listener"></param>
        /// <returns>the previously registered <code>StartChannelListener</code></returns>
        public virtual IStartChannelListener addStartChannelListener(string profile, IStartChannelListener listener, SessionTuningProperties tuning)
        {
            lock (this)
            {
                // Replace semantics - change this if we want to prevent clobbering.
                IStartChannelListener temp = null;

                if (profileListeners[profile] != null)
                {
                    temp = ((InternalProfile) profileListeners[profile]).listener;
                }

                InternalProfile tempProfile = new InternalProfile(this);

                tempProfile.listener = listener;

                tempProfile.tuning = tuning;

                profileListeners[profile] = tempProfile;

                return temp;
            }
        }
Ejemplo n.º 2
0
	/*
	 * Tries to write to a save file for the current player.
	 * In the future, this may need to consider a player
	 * name so we can have multiple save files.
	 */
	public void save() {
		Debug.Log("Saving file to " + savePath);

		BinaryFormatter binForm = new BinaryFormatter ();

		FileStream saveFile;
		if (File.Exists (savePath)) {
			saveFile = File.Open (savePath, FileMode.Open);
		} else saveFile = File.Create (savePath);

		InternalProfile saveData = new InternalProfile ();
		saveData.money = money;
        saveData.memoryCardCapacity = memoryCardCapacity;
		saveData.bagSize = bagSize;
		saveData.lenses = lenses;
		saveData.filters = filters;
		saveData.postedPhotos = postedPhotos;
		saveData.maxInterestTotal = maxInterestTotal;
		saveData.maxInterestIndividual = maxInterestIndividual;

		saveData.tutFlagMovement = tutFlagMovement;
		saveData.tutFlagAim = tutFlagAim;
		saveData.tutFlagSnap = tutFlagSnap;
		saveData.tutFlagLook = tutFlagLook;
		saveData.tutFlagJump = tutFlagJump;
		saveData.tutFlagRun = tutFlagRun;
		saveData.tutFlagAperture = tutFlagAperture;
		saveData.tutFlagWhiteBalance = tutFlagWhiteBalance;
		saveData.tutFlagChangeLens = tutFlagChangeLens;
		saveData.tutFlagShutterSpeed = tutFlagShutterSpeed;
		saveData.tutFlagViewControls = tutFlagViewControls;

		saveData.timeElapsedInPark = timeElapsedInPark;
		saveData.timeElapsedInMenu = timeElapsedInMenu;
		saveData.lensesInBag = lensesInBag;
		saveData.filtersInBag = filtersInBag;

		saveData.blogNamed = blogNamed;
		saveData.blogNameChangeTipSeen = blogNameChangeTipSeen;
		saveData.blogName = blogName;

		binForm.Serialize (saveFile, saveData);
		saveFile.Close ();
	}