Nothing
This commit is contained in:
parent
3a43829772
commit
6801002120
1 changed files with 48 additions and 0 deletions
48
Nasal/Systems/Comm/CPDLC.nas
Normal file
48
Nasal/Systems/Comm/CPDLC.nas
Normal file
|
@ -0,0 +1,48 @@
|
|||
# A3XX CPDLC
|
||||
# Jonathan Redpath
|
||||
|
||||
# Copyright (c) 2020 Josh Davidson (Octal450)
|
||||
var DictionaryItem = {
|
||||
new: func(item, string) {
|
||||
var DI = {parents: [DictionaryItem]};
|
||||
DI.item = item;
|
||||
DI.string = string;
|
||||
return DI;
|
||||
},
|
||||
};
|
||||
|
||||
var Dictionary = {
|
||||
database: std.Vector.new(),
|
||||
addToDatabase: func(dictItem) {
|
||||
me.database.append(dictItem);
|
||||
},
|
||||
fetchString: func(string) {
|
||||
foreach (var item; me.database.vector) {
|
||||
if (me.item.string == string) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
},
|
||||
fetchItem: func(itemObj) {
|
||||
foreach (var item; me.database.vector) {
|
||||
if (item.item == itemObj) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
makeNewDictionaryItem = func(item, string) {
|
||||
var dictItem = DictionaryItem.new(item, string);
|
||||
Dictionary.addToDatabase(dictItem);
|
||||
};
|
||||
|
||||
var CPDLCmessage = {
|
||||
new: func(text) {
|
||||
var cpdlcMessage = {parents: [CPDLCmessage] };
|
||||
cpdlcMessage.text = text;
|
||||
return cpdlcMessage;
|
||||
},
|
||||
};
|
||||
|
||||
makeNewDictionaryItem(CPDLCmessage.new("CONNECT"), "CONNECT");
|
Loading…
Reference in a new issue