TwitCore/Helpers/UserAnalyser.cs
/// <summary>
/// This method is used to initialise all the users from the initial text file.
/// </summary>
/// <param name="file">Text File.</param>
/// <returns>List of all the users.</returns>
This method is used to initialise all the users from the initial text file.
This method is used to initialise all the users from the initial text file .
public static List<IPerson> UsersInit(this TextFile file) {
            var result = new List<IPerson>();
            file.ReadFileToList().ForEach(line => {
                var fStartEnd = line.GetStartEnd("follows");
                if (fStartEnd.Item1 != 0 && fStartEnd.Item2 != 0) {
                    var handle = line.Substring(0, fStartEnd.Item1).Trim(' ');
                    var userFollowers = line.Substring(fStartEnd.Item2).Split(',').ToList();
                    AddUser(result, handle, userFollowers);
                }
            });
            return result;
        }
public static List < IPerson > UsersInit ( this TextFile file ) { var result = new List < IPerson > ( ) ; file . ReadFileToList ( ) . ForEach ( line => { var fStartEnd = line . GetStartEnd ( " " ) ; if ( fStartEnd . Item1 != 0 && fStartEnd . Item2 != 0 ) { var handle = line . Substring ( 0 , fStartEnd . Item1 ) . Trim ( ' ' ) ; var userFollowers = line . Substring ( fStartEnd . Item2 ) . Split ( ' ' ) . ToList ( ) ; AddUser ( result , handle , userFollowers ) ; } } ) ; return result ; }
This method is used to initialise all the users from the initial text file.
This method is used to initialise all the users from the initial text file .
List of all the users.
List of all the users .
TextFile
this
file
None