<commit_before>﻿using UnityEngine;
using System.Collections;
using System.IO;

using DPek.Raconteur.RenPy.State;
using DPek.Raconteur.Util.Parser;

namespace DPek.Raconteur.RenPy.Script
{
	/// <summary>
	/// Ren'Py play statement.
	/// </summary>
	public class RenPyPlay : RenPyStatement
	{
		private string m_channel;
		private string m_file;
		private bool m_loop;
		private bool m_ifChanged;
		private float m_fadeinTime;
		private float m_fadeoutTime;

		/// <summary>
		/// Initializes this statement with the passed scanner.
		/// </summary>
		/// <param name="tokens">
		/// The scanner to use to initialize this statement.
		/// </param>
		public RenPyPlay(ref Scanner tokens) : base(RenPyStatementType.PLAY)
		{
			tokens.Seek("play");
			tokens.Next();

			// Get channel and setup default looping behaviour
			tokens.Seek(new string [] {"music", "sound"});
			m_channel = tokens.Next();
			m_loop = (m_channel == "music" ? true : false);

			// TODO: support multiple play statements<commit_msg>Recognize voice channel in RenPyPlay. Fixes #48<commit_after>﻿using UnityEngine;
using System.Collections;
using System.IO;

using DPek.Raconteur.RenPy.State;
using DPek.Raconteur.Util.Parser;

namespace DPek.Raconteur.RenPy.Script
{
	/// <summary>
	/// Ren'Py play statement.
	/// </summary>
	public class RenPyPlay : RenPyStatement
	{
		private string m_channel;
		private string m_file;
		private bool m_loop;
		private bool m_ifChanged;
		private float m_fadeinTime;
		private float m_fadeoutTime;

		/// <summary>
		/// Initializes this statement with the passed scanner.
		/// </summary>
		/// <param name="tokens">
		/// The scanner to use to initialize this statement.
		/// </param>
		public RenPyPlay(ref Scanner tokens) : base(RenPyStatementType.PLAY)
		{
			tokens.Seek("play");
			tokens.Next();

			// Get channel and setup default looping behaviour
			tokens.Seek(new string [] {"music", "sound", "voice"});
			m_channel = tokens.Next();
			m_loop = (m_channel == "music" ? true : false);

			// TODO: support multiple play statements
{'fraction_non_alphanumeric': 0.12700729927007298, 'fraction_numerical': 0.0009732360097323601, 'mean_word_length': 3.5386313465783665, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6975087', 'n_tokens_mistral': 736, 'n_tokens_neox': 647, 'n_words': 184}