//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// InputGameClassArray is adapter for slice of InputGameClass.
type InputGameClassArray []InputGameClass

// Sort sorts slice of InputGameClass.
func ( InputGameClassArray) ( func(,  InputGameClass) bool) InputGameClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputGameClass.
func ( InputGameClassArray) ( func(,  InputGameClass) bool) InputGameClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputGameClass.
func ( InputGameClassArray) ( func( InputGameClass) bool) InputGameClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputGameClassArray) () ( InputGameClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputGameClassArray) () ( InputGameClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputGameClassArray) () ( InputGameClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputGameClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputGameClassArray) () ( InputGameClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsInputGameID returns copy with only InputGameID constructors.
func ( InputGameClassArray) () ( InputGameIDArray) {
	for ,  := range  {
		,  := .(*InputGameID)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputGameShortName returns copy with only InputGameShortName constructors.
func ( InputGameClassArray) () ( InputGameShortNameArray) {
	for ,  := range  {
		,  := .(*InputGameShortName)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputGameIDArray is adapter for slice of InputGameID.
type InputGameIDArray []InputGameID

// Sort sorts slice of InputGameID.
func ( InputGameIDArray) ( func(,  InputGameID) bool) InputGameIDArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputGameID.
func ( InputGameIDArray) ( func(,  InputGameID) bool) InputGameIDArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputGameID.
func ( InputGameIDArray) ( func( InputGameID) bool) InputGameIDArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputGameIDArray) () ( InputGameID,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputGameIDArray) () ( InputGameID,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputGameIDArray) () ( InputGameID,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputGameID
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputGameIDArray) () ( InputGameID,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// SortByID sorts slice of InputGameID by ID.
func ( InputGameIDArray) () InputGameIDArray {
	return .Sort(func(,  InputGameID) bool {
		return .GetID() < .GetID()
	})
}

// SortStableByID sorts slice of InputGameID by ID.
func ( InputGameIDArray) () InputGameIDArray {
	return .SortStable(func(,  InputGameID) bool {
		return .GetID() < .GetID()
	})
}

// FillMap fills constructors to given map.
func ( InputGameIDArray) ( map[int64]InputGameID) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputGameIDArray) () map[int64]InputGameID {
	 := make(map[int64]InputGameID, len())
	.FillMap()
	return 
}

// InputGameShortNameArray is adapter for slice of InputGameShortName.
type InputGameShortNameArray []InputGameShortName

// Sort sorts slice of InputGameShortName.
func ( InputGameShortNameArray) ( func(,  InputGameShortName) bool) InputGameShortNameArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of InputGameShortName.
func ( InputGameShortNameArray) ( func(,  InputGameShortName) bool) InputGameShortNameArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of InputGameShortName.
func ( InputGameShortNameArray) ( func( InputGameShortName) bool) InputGameShortNameArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( InputGameShortNameArray) () ( InputGameShortName,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( InputGameShortNameArray) () ( InputGameShortName,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *InputGameShortNameArray) () ( InputGameShortName,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  InputGameShortName
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *InputGameShortNameArray) () ( InputGameShortName,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}